@itwin/core-backend 3.5.0-dev.7 → 3.6.0-dev.1

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 (140) hide show
  1. package/CHANGELOG.md +92 -1
  2. package/lib/cjs/BriefcaseManager.d.ts +7 -2
  3. package/lib/cjs/BriefcaseManager.d.ts.map +1 -1
  4. package/lib/cjs/BriefcaseManager.js +11 -3
  5. package/lib/cjs/BriefcaseManager.js.map +1 -1
  6. package/lib/cjs/ChangeSummaryManager.d.ts.map +1 -1
  7. package/lib/cjs/ChangeSummaryManager.js +2 -0
  8. package/lib/cjs/ChangeSummaryManager.js.map +1 -1
  9. package/lib/cjs/ClassRegistry.d.ts +8 -0
  10. package/lib/cjs/ClassRegistry.d.ts.map +1 -1
  11. package/lib/cjs/ClassRegistry.js +47 -13
  12. package/lib/cjs/ClassRegistry.js.map +1 -1
  13. package/lib/cjs/CloudSqlite.d.ts +1 -0
  14. package/lib/cjs/CloudSqlite.d.ts.map +1 -1
  15. package/lib/cjs/CloudSqlite.js +1 -0
  16. package/lib/cjs/CloudSqlite.js.map +1 -1
  17. package/lib/cjs/ConcurrentQuery.d.ts +3 -1
  18. package/lib/cjs/ConcurrentQuery.d.ts.map +1 -1
  19. package/lib/cjs/ConcurrentQuery.js +6 -0
  20. package/lib/cjs/ConcurrentQuery.js.map +1 -1
  21. package/lib/cjs/CustomViewState3dCreator.d.ts +3 -14
  22. package/lib/cjs/CustomViewState3dCreator.d.ts.map +1 -1
  23. package/lib/cjs/CustomViewState3dCreator.js +11 -43
  24. package/lib/cjs/CustomViewState3dCreator.js.map +1 -1
  25. package/lib/cjs/DisplayStyle.d.ts +9 -9
  26. package/lib/cjs/DisplayStyle.d.ts.map +1 -1
  27. package/lib/cjs/DisplayStyle.js +12 -12
  28. package/lib/cjs/DisplayStyle.js.map +1 -1
  29. package/lib/cjs/Element.d.ts +23 -30
  30. package/lib/cjs/Element.d.ts.map +1 -1
  31. package/lib/cjs/Element.js +42 -46
  32. package/lib/cjs/Element.js.map +1 -1
  33. package/lib/cjs/ElementAspect.d.ts +24 -4
  34. package/lib/cjs/ElementAspect.d.ts.map +1 -1
  35. package/lib/cjs/ElementAspect.js +35 -2
  36. package/lib/cjs/ElementAspect.js.map +1 -1
  37. package/lib/cjs/Entity.d.ts +31 -1
  38. package/lib/cjs/Entity.d.ts.map +1 -1
  39. package/lib/cjs/Entity.js +52 -0
  40. package/lib/cjs/Entity.js.map +1 -1
  41. package/lib/cjs/EntityReferences.d.ts +50 -0
  42. package/lib/cjs/EntityReferences.d.ts.map +1 -0
  43. package/lib/cjs/EntityReferences.js +96 -0
  44. package/lib/cjs/EntityReferences.js.map +1 -0
  45. package/lib/cjs/ExternalSource.d.ts +3 -1
  46. package/lib/cjs/ExternalSource.d.ts.map +1 -1
  47. package/lib/cjs/ExternalSource.js +6 -0
  48. package/lib/cjs/ExternalSource.js.map +1 -1
  49. package/lib/cjs/GeoCoordConfig.d.ts.map +1 -1
  50. package/lib/cjs/GeoCoordConfig.js +10 -7
  51. package/lib/cjs/GeoCoordConfig.js.map +1 -1
  52. package/lib/cjs/HubMock.d.ts +1 -0
  53. package/lib/cjs/HubMock.d.ts.map +1 -1
  54. package/lib/cjs/HubMock.js +34 -2
  55. package/lib/cjs/HubMock.js.map +1 -1
  56. package/lib/cjs/IModelCloneContext.d.ts +5 -82
  57. package/lib/cjs/IModelCloneContext.d.ts.map +1 -1
  58. package/lib/cjs/IModelCloneContext.js +7 -142
  59. package/lib/cjs/IModelCloneContext.js.map +1 -1
  60. package/lib/cjs/IModelDb.d.ts +21 -2
  61. package/lib/cjs/IModelDb.d.ts.map +1 -1
  62. package/lib/cjs/IModelDb.js +64 -14
  63. package/lib/cjs/IModelDb.js.map +1 -1
  64. package/lib/cjs/IModelElementCloneContext.d.ts +90 -0
  65. package/lib/cjs/IModelElementCloneContext.d.ts.map +1 -0
  66. package/lib/cjs/IModelElementCloneContext.js +160 -0
  67. package/lib/cjs/IModelElementCloneContext.js.map +1 -0
  68. package/lib/cjs/IModelHost.d.ts +9 -0
  69. package/lib/cjs/IModelHost.d.ts.map +1 -1
  70. package/lib/cjs/IModelHost.js +9 -2
  71. package/lib/cjs/IModelHost.js.map +1 -1
  72. package/lib/cjs/IpcHost.d.ts +6 -0
  73. package/lib/cjs/IpcHost.d.ts.map +1 -1
  74. package/lib/cjs/IpcHost.js +47 -3
  75. package/lib/cjs/IpcHost.js.map +1 -1
  76. package/lib/cjs/Model.d.ts +8 -2
  77. package/lib/cjs/Model.d.ts.map +1 -1
  78. package/lib/cjs/Model.js +15 -1
  79. package/lib/cjs/Model.js.map +1 -1
  80. package/lib/cjs/NativeHost.d.ts.map +1 -1
  81. package/lib/cjs/NativeHost.js +10 -15
  82. package/lib/cjs/NativeHost.js.map +1 -1
  83. package/lib/cjs/PromiseMemoizer.d.ts +4 -4
  84. package/lib/cjs/PromiseMemoizer.d.ts.map +1 -1
  85. package/lib/cjs/PromiseMemoizer.js +44 -44
  86. package/lib/cjs/PromiseMemoizer.js.map +1 -1
  87. package/lib/cjs/Relationship.d.ts +18 -2
  88. package/lib/cjs/Relationship.d.ts.map +1 -1
  89. package/lib/cjs/Relationship.js +30 -1
  90. package/lib/cjs/Relationship.js.map +1 -1
  91. package/lib/cjs/RpcBackend.d.ts +0 -23
  92. package/lib/cjs/RpcBackend.d.ts.map +1 -1
  93. package/lib/cjs/RpcBackend.js +13 -108
  94. package/lib/cjs/RpcBackend.js.map +1 -1
  95. package/lib/cjs/SqliteStatement.d.ts +81 -4
  96. package/lib/cjs/SqliteStatement.d.ts.map +1 -1
  97. package/lib/cjs/SqliteStatement.js +163 -25
  98. package/lib/cjs/SqliteStatement.js.map +1 -1
  99. package/lib/cjs/ViewDefinition.d.ts +14 -10
  100. package/lib/cjs/ViewDefinition.d.ts.map +1 -1
  101. package/lib/cjs/ViewDefinition.js +31 -20
  102. package/lib/cjs/ViewDefinition.js.map +1 -1
  103. package/lib/cjs/ViewStateHydrator.js +2 -2
  104. package/lib/cjs/ViewStateHydrator.js.map +1 -1
  105. package/lib/cjs/core-backend.d.ts +4 -2
  106. package/lib/cjs/core-backend.d.ts.map +1 -1
  107. package/lib/cjs/core-backend.js +4 -2
  108. package/lib/cjs/core-backend.js.map +1 -1
  109. package/lib/cjs/rpc/multipart.d.ts +12 -0
  110. package/lib/cjs/rpc/multipart.d.ts.map +1 -0
  111. package/lib/cjs/rpc/multipart.js +71 -0
  112. package/lib/cjs/rpc/multipart.js.map +1 -0
  113. package/lib/cjs/rpc/tracing.d.ts +29 -0
  114. package/lib/cjs/rpc/tracing.d.ts.map +1 -0
  115. package/lib/cjs/rpc/tracing.js +74 -0
  116. package/lib/cjs/rpc/tracing.js.map +1 -0
  117. package/lib/cjs/rpc/web/logging.d.ts +10 -0
  118. package/lib/cjs/rpc/web/logging.d.ts.map +1 -0
  119. package/lib/cjs/rpc/web/logging.js +43 -0
  120. package/lib/cjs/rpc/web/logging.js.map +1 -0
  121. package/lib/cjs/rpc/web/request.d.ts +7 -0
  122. package/lib/cjs/rpc/web/request.d.ts.map +1 -0
  123. package/lib/cjs/rpc/web/request.js +74 -0
  124. package/lib/cjs/rpc/web/request.js.map +1 -0
  125. package/lib/cjs/rpc/web/response.d.ts +7 -0
  126. package/lib/cjs/rpc/web/response.d.ts.map +1 -0
  127. package/lib/cjs/rpc/web/response.js +106 -0
  128. package/lib/cjs/rpc/web/response.js.map +1 -0
  129. package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts +4 -2
  130. package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts.map +1 -1
  131. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js +80 -51
  132. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
  133. package/lib/cjs/rpc-impl/IModelTileRpcImpl.d.ts.map +1 -1
  134. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js +13 -15
  135. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +1 -1
  136. package/lib/cjs/workspace/Workspace.d.ts +1 -1
  137. package/lib/cjs/workspace/Workspace.d.ts.map +1 -1
  138. package/lib/cjs/workspace/Workspace.js +2 -2
  139. package/lib/cjs/workspace/Workspace.js.map +1 -1
  140. package/package.json +14 -14
@@ -1 +1 @@
1
- {"version":3,"file":"SqliteStatement.js","sourceRoot":"","sources":["../../src/SqliteStatement.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAkH;AAClH,oDAA4D;AAE5D,6CAA0C;AAmB1C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAa,eAAe;IAI1B,YAA2B,IAAY;QAAZ,SAAI,GAAJ,IAAI,CAAQ;IAAI,CAAC;IAC5C,IAAW,IAAI,KAAqC,OAAO,IAAI,CAAC,KAAM,CAAC,CAAC,CAAC;IACzE,IAAW,GAAG,KAAK,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAEtC,oEAAoE;IACpE,IAAW,UAAU,KAAc,OAAO,SAAS,KAAK,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IAErE;;;;;;OAMG;IACI,OAAO,CAAC,EAAwB,EAAE,SAAS,GAAG,IAAI;QACvD,IAAI,IAAI,CAAC,UAAU;YACjB,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;QACzD,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC;QACd,IAAI,CAAC,KAAK,GAAG,IAAI,uBAAU,CAAC,QAAQ,CAAC,eAAe,EAAE,CAAC;QACvD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IAC/C,CAAC;IAED;;OAEG;IACH,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;IAChC,CAAC;IAED;OACG;IACI,KAAK;QACV,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;IACpB,CAA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Y,CAAC,IAAU;QAC5B,IAAA,qBAAM,EAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAExB,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC3C,IAAI,QAAQ,KAAK,SAAS,EAAE;YAC1B,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,iGAAiG;YACjH,OAAO;SACR;QACD,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE;YACzC,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,EAAG,CAAC;YACpC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;SACrB;QACD,IAAI,CAAC,KAAK,EAAE,CAAC;QACb,IAAI,CAAC,aAAa,EAAE,CAAC;QACrB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAClC,CAAC;IAEM,aAAa,CAAC,GAAW;QAC9B,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACjC,CAAC;IAEM,KAAK;QACV,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;QAC9C,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IACtB,CAAC;CACF;AAjCD,wCAiCC","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 SQLite\r\n */\r\n\r\nimport { assert, BentleyError, DbResult, GuidString, Id64String, IDisposable, LRUMap } from \"@itwin/core-bentley\";\r\nimport { ECJsNames, IModelError } from \"@itwin/core-common\";\r\nimport { IModelJsNative } from \"@bentley/imodeljs-native\";\r\nimport { IModelHost } from \"./IModelHost\";\r\n\r\n/* eslint-disable @typescript-eslint/no-non-null-assertion */\r\n\r\n/** Marks a string as either an [Id64String]($core-bentley) or [GuidString]($core-bentley), so\r\n * that it can be passed to the [bindValue]($backend.SqliteStatement) or [bindValues]($backend.SqliteStatement)\r\n * methods of [SqliteStatement]($backend).\r\n * @internal\r\n */\r\nexport interface StringParam {\r\n id?: Id64String;\r\n guid?: GuidString;\r\n}\r\n\r\n/** parameter Index (1-based), or name of the parameter (including the initial ':', '@' or '$')\r\n * @public\r\n */\r\nexport type BindParameter = number | string;\r\n\r\n/** Executes SQLite SQL statements.\r\n *\r\n * A statement must be prepared before it can be executed, and it must be released when no longer needed.\r\n * See [IModelDb.withPreparedSqliteStatement]($backend) or\r\n * [ECDb.withPreparedSqliteStatement]($backend) for a convenient and\r\n * reliable way to prepare, execute, and then release a statement.\r\n *\r\n * A statement may contain parameters that must be filled in before use by calling [SqliteStatement.bindValue]($backend)\r\n * or [SqliteStatement.bindValues]($backend).\r\n *\r\n * Once prepared (and parameters are bound, if any), the statement is executed by calling [SqliteStatement.step]($backend).\r\n * In case of an **SQL SELECT** statement, the current row can be retrieved with [SqliteStatement.getRow]($backend) as\r\n * a whole, or with [SqliteStatement.getValue]($backend) when individual values are needed.\r\n * Alternatively, query results of an **SQL SELECT** statement can be stepped through by using\r\n * standard iteration syntax, such as `for of`.\r\n *\r\n * > Preparing a statement can be time-consuming. The best way to reduce the effect of this overhead is to cache and reuse prepared\r\n * > statements. A cached prepared statement may be used in different places in an app, as long as the statement is general enough.\r\n * > The key to making this strategy work is to phrase a statement in a general way and use placeholders to represent parameters that will vary on each use.\r\n * @public\r\n */\r\nexport class SqliteStatement implements IterableIterator<any>, IDisposable {\r\n private _stmt: IModelJsNative.SqliteStatement | undefined;\r\n private _db: IModelJsNative.AnyDb | undefined;\r\n\r\n public constructor(private _sql: string) { }\r\n public get stmt(): IModelJsNative.SqliteStatement { return this._stmt!; }\r\n public get sql() { return this._sql; }\r\n\r\n /** Check if this statement has been prepared successfully or not */\r\n public get isPrepared(): boolean { return undefined !== this._stmt; }\r\n\r\n /** Prepare this statement prior to first use.\r\n * @param db The DgnDb or ECDb to prepare the statement against\r\n * @param sql The SQL statement string to prepare\r\n * @param logErrors Determine if errors are logged or not\r\n * @throws if the SQL statement cannot be prepared. Normally, prepare fails due to SQL syntax errors or references to tables or properties that do not exist.\r\n * The error.message property will provide details.\r\n */\r\n public prepare(db: IModelJsNative.AnyDb, logErrors = true): void {\r\n if (this.isPrepared)\r\n throw new Error(\"SqliteStatement is already prepared\");\r\n this._db = db;\r\n this._stmt = new IModelHost.platform.SqliteStatement();\r\n this._stmt.prepare(db, this._sql, logErrors);\r\n }\r\n\r\n /** Indicates whether the prepared statement makes no **direct* changes to the content of the file\r\n * or not. See [SQLite docs](https://www.sqlite.org/c3ref/stmt_readonly.html) for details.\r\n */\r\n public get isReadonly(): boolean {\r\n return this.stmt.isReadonly();\r\n }\r\n\r\n /** Reset this statement so that the next call to step will return the first row, if any.\r\n */\r\n public reset(): void {\r\n this.stmt.reset();\r\n }\r\n\r\n /** Call this function when finished with this statement. This releases the native resources held by the statement. */\r\n public dispose(): void {\r\n if (this._stmt) {\r\n this._stmt.dispose(); // free native statement\r\n this._stmt = undefined;\r\n this._db = undefined;\r\n }\r\n }\r\n\r\n /**\r\n * Call `step` on this statement and determine whether a new row is available.\r\n * Use this method only when this statement has been prepared with a SELECT statement.\r\n * @return true if a new row is available, false otherwise.\r\n * @throws if `step` returns anything other than BE_SQLITE_ROW or BE_SQLITE_DONE.\r\n */\r\n public nextRow(): boolean {\r\n const rc = this.step();\r\n switch (rc) {\r\n case DbResult.BE_SQLITE_ROW:\r\n return true;\r\n case DbResult.BE_SQLITE_DONE:\r\n return false;\r\n }\r\n\r\n throw new BentleyError(rc, this._db!.getLastError());\r\n }\r\n\r\n /** Binds a value to the specified SQL parameter.\r\n * The value must be of one of these types:\r\n * JavaScript Type | SQLite Type\r\n * --- | ---\r\n * undefined | NULL\r\n * boolean | INTEGER with true being bound as 1 and false as 0\r\n * number | INTEGER if number is integral or REAL if number is not integral\r\n * string | TEXT\r\n * Uint8Array or ArrayBuffer | BLOB\r\n * [StringParam]($backend) where member **id** is set | INTEGER\r\n * [StringParam]($backend) where member **guid** is set | BLOB\r\n *\r\n * @param parameter Index (1-based) or name of the parameter (including the initial ':', '@' or '$')\r\n * @param value Value to bind.\r\n * @throws [IModelError]($common) if the value is of an unsupported type or in\r\n * case of other binding errors.\r\n */\r\n public bindValue(parameter: BindParameter, value: any): void {\r\n let stat: DbResult;\r\n if (value === undefined || value === null) {\r\n stat = this.stmt.bindNull(parameter);\r\n } else if (typeof (value) === \"number\") {\r\n if (Number.isInteger(value))\r\n stat = this.stmt.bindInteger(parameter, value);\r\n else\r\n stat = this.stmt.bindDouble(parameter, value);\r\n } else if (typeof (value) === \"boolean\") {\r\n stat = this.stmt.bindInteger(parameter, value ? 1 : 0);\r\n } else if (typeof (value) === \"string\") {\r\n stat = this.stmt.bindString(parameter, value);\r\n } else if (!!value.id) {\r\n stat = this.stmt.bindId(parameter, value.id);\r\n } else if (!!value.guid) {\r\n stat = this.stmt.bindGuid(parameter, value.guid);\r\n } else if (value instanceof Uint8Array) {\r\n stat = this.stmt.bindBlob(parameter, value);\r\n } else\r\n throw new IModelError(DbResult.BE_SQLITE_ERROR, `Parameter value ${value} is of an unsupported data type.`);\r\n\r\n if (stat !== DbResult.BE_SQLITE_OK)\r\n throw new IModelError(stat, \"Error in bindValue\");\r\n }\r\n\r\n private checkBind(stat: DbResult) {\r\n if (stat !== DbResult.BE_SQLITE_OK)\r\n throw new IModelError(stat, \"SQLite Bind error\");\r\n }\r\n /** Bind an integer parameter\r\n * @param parameter Index (1-based) or name of the parameter (including the initial ':', '@' or '$')\r\n * @param val integer to bind.\r\n */\r\n public bindInteger(parameter: BindParameter, val: number) {\r\n this.checkBind(this.stmt.bindInteger(parameter, val));\r\n }\r\n /** Bind a double parameter\r\n * @param parameter Index (1-based) or name of the parameter (including the initial ':', '@' or '$')\r\n * @param val double to bind.\r\n */\r\n public bindDouble(parameter: BindParameter, val: number) {\r\n this.checkBind(this.stmt.bindDouble(parameter, val));\r\n }\r\n /** Bind a string parameter\r\n * @param parameter Index (1-based) or name of the parameter (including the initial ':', '@' or '$')\r\n * @param val string to bind.\r\n */\r\n public bindString(parameter: BindParameter, val: string) {\r\n this.checkBind(this.stmt.bindString(parameter, val));\r\n }\r\n /** Bind an Id64String parameter as a 64-bit integer\r\n * @param parameter Index (1-based) or name of the parameter (including the initial ':', '@' or '$')\r\n * @param val Id to bind.\r\n */\r\n public bindId(parameter: BindParameter, id: Id64String) {\r\n this.checkBind(this.stmt.bindId(parameter, id));\r\n }\r\n /** Bind a Guid parameter\r\n * @param parameter Index (1-based) or name of the parameter (including the initial ':', '@' or '$')\r\n * @param val Guid to bind.\r\n */\r\n public bindGuid(parameter: BindParameter, guid: GuidString) {\r\n this.checkBind(this.stmt.bindGuid(parameter, guid));\r\n }\r\n /** Bind a blob parameter\r\n * @param parameter Index (1-based) or name of the parameter (including the initial ':', '@' or '$')\r\n * @param val blob to bind.\r\n */\r\n public bindBlob(parameter: BindParameter, blob: Uint8Array) {\r\n this.checkBind(this.stmt.bindBlob(parameter, blob));\r\n }\r\n /** Bind null to a parameter\r\n * @param parameter Index (1-based) or name of the parameter (including the initial ':', '@' or '$')\r\n */\r\n public bindNull(parameter: BindParameter) {\r\n this.checkBind(this.stmt.bindNull(parameter));\r\n }\r\n\r\n /** Bind values to all parameters in the statement.\r\n * @param values The values to bind to the parameters.\r\n * Pass an *array* of values if the parameters are *positional*.\r\n * Pass an *object of the values keyed on the parameter name* for *named parameters*.\r\n * The values in either the array or object must match the respective types of the parameter.\r\n * See [[SqliteStatement.bindValue]] for details on the supported types.\r\n */\r\n public bindValues(values: any[] | object): void {\r\n if (Array.isArray(values)) {\r\n for (let i = 0; i < values.length; i++) {\r\n const paramIndex: number = i + 1;\r\n const paramValue: any = values[i];\r\n if (paramValue === undefined || paramValue === null)\r\n continue;\r\n\r\n this.bindValue(paramIndex, paramValue);\r\n }\r\n return;\r\n }\r\n\r\n for (const entry of Object.entries(values)) {\r\n const paramName: string = entry[0];\r\n const paramValue: any = entry[1];\r\n if (paramValue === undefined || paramValue === null)\r\n continue;\r\n\r\n this.bindValue(paramName, paramValue);\r\n }\r\n }\r\n\r\n /** Clear any bindings that were previously set on this statement.\r\n * @throws [IModelError]($common) in case of errors\r\n */\r\n public clearBindings(): void {\r\n const stat = this.stmt.clearBindings();\r\n if (stat !== DbResult.BE_SQLITE_OK)\r\n throw new IModelError(stat, \"Error in clearBindings\");\r\n }\r\n\r\n /** Step this statement to the next row.\r\n *\r\n * For **SQL SELECT** statements the method returns\r\n * - [DbResult.BE_SQLITE_ROW]($core-bentley) if the statement now points successfully to the next row.\r\n * - [DbResult.BE_SQLITE_DONE]($core-bentley) if the statement has no more rows.\r\n * - Error status in case of errors.\r\n *\r\n * For **SQL INSERT, UPDATE, DELETE** statements the method returns\r\n * - [DbResult.BE_SQLITE_DONE]($core-bentley) if the statement has been executed successfully.\r\n * - Error status in case of errors.\r\n */\r\n public step(): DbResult { return this.stmt.step(); }\r\n\r\n /** Get the query result's column count (only for SQL SELECT statements). */\r\n public getColumnCount(): number { return this.stmt.getColumnCount(); }\r\n\r\n /** Get the value for the column at the given index in the query result.\r\n * @param columnIx Index of SQL column in query result (0-based)\r\n */\r\n public getValue(columnIx: number): SqliteValue { return new SqliteValue(this.stmt, columnIx); }\r\n\r\n /** Determine whether the value of the specified column is null\r\n * @param colIndex Index of SQL column in query result (0-based)\r\n */\r\n public isValueNull(colIndex: number): boolean { return this.stmt.isValueNull(colIndex); }\r\n\r\n /** Get a size in bytes of a blob or text column\r\n * @param colIndex Index of SQL column in query result (0-based)\r\n */\r\n public getColumnBytes(colIndex: number): number { return this.stmt.getColumnBytes(colIndex); }\r\n\r\n /** Get a value as a blob\r\n * @param colIndex Index of SQL column in query result (0-based)\r\n */\r\n public getValueBlob(colIndex: number): Uint8Array { return this.stmt.getValueBlob(colIndex); }\r\n /** Get a value as a double\r\n * @param colIndex Index of SQL column in query result (0-based)\r\n */\r\n public getValueDouble(colIndex: number): number { return this.stmt.getValueDouble(colIndex); }\r\n /** Get a value as a integer\r\n * @param colIndex Index of SQL column in query result (0-based)\r\n */\r\n public getValueInteger(colIndex: number): number { return this.stmt.getValueInteger(colIndex); }\r\n /** Get a value as a string\r\n * @param colIndex Index of SQL column in query result (0-based)\r\n */\r\n public getValueString(colIndex: number): string { return this.stmt.getValueString(colIndex); }\r\n /** Get a value as an Id\r\n * @param colIndex Index of SQL column in query result (0-based)\r\n */\r\n public getValueId(colIndex: number): Id64String { return this.stmt.getValueId(colIndex); }\r\n /** Get a value as a Guid\r\n * @param colIndex Index of SQL column in query result (0-based)\r\n */\r\n public getValueGuid(colIndex: number): GuidString { return this.stmt.getValueGuid(colIndex); }\r\n\r\n /** Get the current row.\r\n * The returned row is formatted as JavaScript object where every SELECT clause item becomes a property in the JavaScript object.\r\n *\r\n * The SQL select clause item's name becomes the member name of the JavaScript object, **with the first character lowered**.\r\n *\r\n * SQLite Type | JavaScript Type\r\n * --- | ---\r\n * [SqliteValueType.Null]($backend) | undefined\r\n * [SqliteValueType.Integer]($backend) | number\r\n * [SqliteValueType.Double]($backend) | number\r\n * [SqliteValueType.String]($backend) | string\r\n * [SqliteValueType.Blob]($backend) | Uint8Array\r\n */\r\n public getRow(): any {\r\n const colCount = this.getColumnCount();\r\n const row: object = {};\r\n const duplicatePropNames = new Map<string, number>();\r\n for (let i = 0; i < colCount; i++) {\r\n const sqliteValue = this.getValue(i);\r\n if (!sqliteValue.isNull) {\r\n const propName: string = SqliteStatement.determineResultRowPropertyName(duplicatePropNames, sqliteValue);\r\n let val: any;\r\n switch (sqliteValue.type) {\r\n case SqliteValueType.Blob:\r\n val = sqliteValue.getBlob();\r\n break;\r\n case SqliteValueType.Double:\r\n val = sqliteValue.getDouble();\r\n break;\r\n case SqliteValueType.Integer:\r\n val = sqliteValue.getInteger();\r\n break;\r\n case SqliteValueType.String:\r\n val = sqliteValue.getString();\r\n break;\r\n\r\n default:\r\n throw new Error(\"Unsupported SqliteValueType\");\r\n }\r\n\r\n Object.defineProperty(row, propName, { enumerable: true, configurable: true, writable: true, value: val });\r\n }\r\n }\r\n return row;\r\n }\r\n\r\n private static determineResultRowPropertyName(duplicatePropNames: Map<string, number>, sqliteValue: SqliteValue): string {\r\n let jsName = ECJsNames.toJsName(sqliteValue.columnName);\r\n\r\n // now check duplicates. If there are, append a numeric suffix to the duplicates\r\n let suffix = duplicatePropNames.get(jsName);\r\n if (suffix === undefined)\r\n duplicatePropNames.set(jsName, 0);\r\n else {\r\n suffix++;\r\n duplicatePropNames.set(jsName, suffix);\r\n jsName += `_${suffix}`;\r\n }\r\n\r\n return jsName;\r\n }\r\n\r\n /** Calls step when called as an iterator.\r\n */\r\n public next(): IteratorResult<any> {\r\n return DbResult.BE_SQLITE_ROW === this.step() ? { done: false, value: this.getRow() } : { done: true, value: undefined };\r\n }\r\n\r\n /** The iterator that will step through the results of this statement. */\r\n public [Symbol.iterator](): IterableIterator<any> { return this; }\r\n}\r\n\r\n/** Data type of a value in in an SQLite SQL query result.\r\n * See also:\r\n * - [SqliteValue]($backend)\r\n * - [SqliteStatement]($backend)\r\n * - [SqliteStatement.getValue]($backend)\r\n * @public\r\n */\r\nexport enum SqliteValueType {\r\n // do not change the values of that enum. It must correspond to the respective\r\n // enum DbValueType in the native BeSQLite API.\r\n Integer = 1,\r\n Double = 2,\r\n String = 3,\r\n Blob = 4,\r\n Null = 5,\r\n}\r\n\r\n/** Value of a column in a row of an SQLite SQL query result.\r\n * See also:\r\n * - [SqliteStatement]($backend)\r\n * - [SqliteStatement.getValue]($backend)\r\n * @public\r\n */\r\nexport class SqliteValue {\r\n private readonly _stmt: IModelJsNative.SqliteStatement;\r\n private readonly _colIndex: number;\r\n\r\n public constructor(stmt: IModelJsNative.SqliteStatement, colIndex: number) {\r\n this._stmt = stmt;\r\n this._colIndex = colIndex;\r\n }\r\n\r\n /** Indicates whether the value is NULL or not. */\r\n public get isNull(): boolean { return this._stmt.isValueNull(this._colIndex); }\r\n\r\n /** Gets the data type of the value. */\r\n public get type(): SqliteValueType { return this._stmt.getColumnType(this._colIndex); }\r\n\r\n /** Gets the name of the column of the value. */\r\n public get columnName(): string { return this._stmt.getColumnName(this._colIndex); }\r\n\r\n /** Gets the SqlValue as JavaScript value.\r\n *\r\n * SQLite Type | JavaScript Type\r\n * --- | ---\r\n * [SqliteValueType.Null]($backend) | undefined\r\n * [SqliteValueType.Integer]($backend) | number\r\n * [SqliteValueType.Double]($backend) | number\r\n * [SqliteValueType.String]($backend) | string\r\n * [SqliteValueType.Blob]($backend) | Uint8Array\r\n */\r\n public get value(): any {\r\n switch (this.type) {\r\n case SqliteValueType.Null:\r\n return undefined;\r\n case SqliteValueType.Blob:\r\n return this.getBlob();\r\n case SqliteValueType.Double:\r\n return this.getDouble();\r\n case SqliteValueType.Integer:\r\n return this.getInteger();\r\n case SqliteValueType.String:\r\n return this.getString();\r\n default:\r\n throw new Error(\"Unhandled SqliteValueType\");\r\n }\r\n }\r\n\r\n /** Get the value as BLOB */\r\n public getBlob(): Uint8Array { return this._stmt.getValueBlob(this._colIndex); }\r\n /** Get the value as a double value */\r\n public getDouble(): number { return this._stmt.getValueDouble(this._colIndex); }\r\n /** Get the value as a integer value */\r\n public getInteger(): number { return this._stmt.getValueInteger(this._colIndex); }\r\n /** Get the value as a string value */\r\n public getString(): string { return this._stmt.getValueString(this._colIndex); }\r\n /** Get the value as an Id value */\r\n public getId(): Id64String { return this._stmt.getValueId(this._colIndex); }\r\n /** Get the value as a Guid value */\r\n public getGuid(): GuidString { return this._stmt.getValueGuid(this._colIndex); }\r\n}\r\n\r\ninterface Statement {\r\n isPrepared: boolean;\r\n sql: string;\r\n dispose(): void;\r\n reset(): void;\r\n clearBindings(): void;\r\n}\r\n\r\n/** A cache for previously prepared SqliteStatements.\r\n * It only holds Statements after they are no longer in use, resetting and clearing their bindings before saving them.\r\n * When a request to use a statement from the cache is made, it is first removed from the cache.\r\n * @internal\r\n */\r\nexport class StatementCache<Stmt extends Statement> {\r\n private _cache: LRUMap<string, Stmt>;\r\n\r\n public constructor(maxCount = 40) {\r\n this._cache = new LRUMap<string, Stmt>(maxCount);\r\n }\r\n\r\n public get size() { return this._cache.size; }\r\n public addOrDispose(stmt: Stmt): void {\r\n assert(stmt.isPrepared);\r\n\r\n const existing = this._cache.get(stmt.sql);\r\n if (existing !== undefined) {\r\n stmt.dispose(); // we already have a statement with this sql cached, we can't save another one so just dispose it\r\n return;\r\n }\r\n if (this._cache.size >= this._cache.limit) {\r\n const oldest = this._cache.shift()!;\r\n oldest[1].dispose();\r\n }\r\n stmt.reset();\r\n stmt.clearBindings();\r\n this._cache.set(stmt.sql, stmt);\r\n }\r\n\r\n public findAndRemove(sql: string): Stmt | undefined {\r\n return this._cache.delete(sql);\r\n }\r\n\r\n public clear() {\r\n this._cache.forEach((stmt) => stmt.dispose());\r\n this._cache.clear();\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"SqliteStatement.js","sourceRoot":"","sources":["../../src/SqliteStatement.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAkH;AAClH,oDAA4D;AAE5D,6CAA0C;AAqB1C,SAAS,SAAS,CAAC,IAAc;IAC/B,IAAI,IAAI,KAAK,uBAAQ,CAAC,YAAY;QAChC,MAAM,IAAI,yBAAW,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC;AACrD,CAAC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAa,eAAe;IAI1B,YAA2B,IAAY;QAAZ,SAAI,GAAJ,IAAI,CAAQ;IAAI,CAAC;IAC5C,IAAW,IAAI,KAAqC,OAAO,IAAI,CAAC,KAAM,CAAC,CAAC,CAAC;IACzE,IAAW,GAAG,KAAK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rB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAClC,CAAC;IAEM,aAAa,CAAC,GAAW;QAC9B,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACjC,CAAC;IAEM,KAAK;QACV,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;QAC9C,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IACtB,CAAC;CACF;AAjCD,wCAiCC","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 SQLite\r\n */\r\n\r\nimport { assert, BentleyError, DbResult, GuidString, Id64String, IDisposable, LRUMap } from \"@itwin/core-bentley\";\r\nimport { ECJsNames, IModelError } from \"@itwin/core-common\";\r\nimport { IModelJsNative } from \"@bentley/imodeljs-native\";\r\nimport { IModelHost } from \"./IModelHost\";\r\n\r\n// spell:ignore julianday\r\n\r\n/* eslint-disable @typescript-eslint/no-non-null-assertion */\r\n\r\n/** Marks a string as either an [Id64String]($core-bentley) or [GuidString]($core-bentley), so\r\n * that it can be passed to the [bindValue]($backend.SqliteStatement) or [bindValues]($backend.SqliteStatement)\r\n * methods of [SqliteStatement]($backend).\r\n * @internal\r\n */\r\nexport interface StringParam {\r\n id?: Id64String;\r\n guid?: GuidString;\r\n}\r\n\r\n/** parameter Index (1-based), or name of the parameter (including the initial ':', '@' or '$')\r\n * @public\r\n */\r\nexport type BindParameter = number | string;\r\n\r\nfunction checkBind(stat: DbResult) {\r\n if (stat !== DbResult.BE_SQLITE_OK)\r\n throw new IModelError(stat, \"SQLite Bind error\");\r\n}\r\n\r\n/** Executes SQLite SQL statements.\r\n *\r\n * A statement must be prepared before it can be executed, and it must be released when no longer needed.\r\n * See [IModelDb.withPreparedSqliteStatement]($backend) or\r\n * [ECDb.withPreparedSqliteStatement]($backend) for a convenient and\r\n * reliable way to prepare, execute, and then release a statement.\r\n *\r\n * A statement may contain parameters that must be filled in before use by calling [SqliteStatement.bindValue]($backend)\r\n * or [SqliteStatement.bindValues]($backend).\r\n *\r\n * Once prepared (and parameters are bound, if any), the statement is executed by calling [SqliteStatement.step]($backend).\r\n * In case of an **SQL SELECT** statement, the current row can be retrieved with [SqliteStatement.getRow]($backend) as\r\n * a whole, or with [SqliteStatement.getValue]($backend) when individual values are needed.\r\n * Alternatively, query results of an **SQL SELECT** statement can be stepped through by using\r\n * standard iteration syntax, such as `for of`.\r\n *\r\n * > Preparing a statement can be time-consuming. The best way to reduce the effect of this overhead is to cache and reuse prepared\r\n * > statements. A cached prepared statement may be used in different places in an app, as long as the statement is general enough.\r\n * > The key to making this strategy work is to phrase a statement in a general way and use placeholders to represent parameters that will vary on each use.\r\n * @public\r\n */\r\nexport class SqliteStatement implements IterableIterator<any>, IDisposable {\r\n private _stmt: IModelJsNative.SqliteStatement | undefined;\r\n private _db: IModelJsNative.AnyDb | undefined;\r\n\r\n public constructor(private _sql: string) { }\r\n public get stmt(): IModelJsNative.SqliteStatement { return this._stmt!; }\r\n public get sql() { return this._sql; }\r\n\r\n /** Check if this statement has been prepared successfully or not */\r\n public get isPrepared(): boolean { return undefined !== this._stmt; }\r\n\r\n /** Prepare this statement prior to first use.\r\n * @param db The DgnDb or ECDb to prepare the statement against\r\n * @param sql The SQL statement string to prepare\r\n * @param logErrors Determine if errors are logged or not\r\n * @throws if the SQL statement cannot be prepared. Normally, prepare fails due to SQL syntax errors or references to tables or properties that do not exist.\r\n * The error.message property will provide details.\r\n */\r\n public prepare(db: IModelJsNative.AnyDb, logErrors = true): void {\r\n if (this.isPrepared)\r\n throw new Error(\"SqliteStatement is already prepared\");\r\n this._db = db;\r\n this._stmt = new IModelHost.platform.SqliteStatement();\r\n this._stmt.prepare(db, this._sql, logErrors);\r\n }\r\n\r\n /** Indicates whether the prepared statement makes no **direct* changes to the content of the file\r\n * or not. See [SQLite docs](https://www.sqlite.org/c3ref/stmt_readonly.html) for details.\r\n */\r\n public get isReadonly(): boolean {\r\n return this.stmt.isReadonly();\r\n }\r\n\r\n /** Reset this statement so that the next call to step will return the first row, if any.\r\n */\r\n public reset(): void {\r\n this.stmt.reset();\r\n }\r\n\r\n /** Call this function when finished with this statement. This releases the native resources held by the statement. */\r\n public dispose(): void {\r\n if (this._stmt) {\r\n this._stmt.dispose(); // free native statement\r\n this._stmt = undefined;\r\n this._db = undefined;\r\n }\r\n }\r\n\r\n /**\r\n * Call `step` on this statement and determine whether a new row is available.\r\n * Use this method only when this statement has been prepared with a SELECT statement.\r\n * @return true if a new row is available, false otherwise.\r\n * @throws if `step` returns anything other than BE_SQLITE_ROW or BE_SQLITE_DONE.\r\n */\r\n public nextRow(): boolean {\r\n const rc = this.step();\r\n switch (rc) {\r\n case DbResult.BE_SQLITE_ROW:\r\n return true;\r\n case DbResult.BE_SQLITE_DONE:\r\n return false;\r\n }\r\n\r\n throw new BentleyError(rc, this._db!.getLastError());\r\n }\r\n\r\n /** Binds a value to the specified SQL parameter.\r\n * The value must be of one of these types:\r\n * JavaScript Type | SQLite Type\r\n * --- | ---\r\n * undefined | NULL\r\n * boolean | INTEGER with true being bound as 1 and false as 0\r\n * number | INTEGER if number is integral or REAL if number is not integral\r\n * string | TEXT\r\n * Uint8Array or ArrayBuffer | BLOB\r\n * [StringParam]($backend) where member **id** is set | INTEGER\r\n * [StringParam]($backend) where member **guid** is set | BLOB\r\n *\r\n * @param parameter Index (1-based) or name of the parameter (including the initial ':', '@' or '$')\r\n * @param value Value to bind.\r\n * @throws [IModelError]($common) if the value is of an unsupported type or in\r\n * case of other binding errors.\r\n */\r\n public bindValue(parameter: BindParameter, value: any): void {\r\n let stat: DbResult;\r\n if (value === undefined || value === null) {\r\n stat = this.stmt.bindNull(parameter);\r\n } else if (typeof (value) === \"number\") {\r\n if (Number.isInteger(value))\r\n stat = this.stmt.bindInteger(parameter, value);\r\n else\r\n stat = this.stmt.bindDouble(parameter, value);\r\n } else if (typeof (value) === \"boolean\") {\r\n stat = this.stmt.bindInteger(parameter, value ? 1 : 0);\r\n } else if (typeof (value) === \"string\") {\r\n stat = this.stmt.bindString(parameter, value);\r\n } else if (!!value.id) {\r\n stat = this.stmt.bindId(parameter, value.id);\r\n } else if (!!value.guid) {\r\n stat = this.stmt.bindGuid(parameter, value.guid);\r\n } else if (value instanceof Uint8Array) {\r\n stat = this.stmt.bindBlob(parameter, value);\r\n } else\r\n throw new IModelError(DbResult.BE_SQLITE_ERROR, `Parameter value ${value} is of an unsupported data type.`);\r\n\r\n if (stat !== DbResult.BE_SQLITE_OK)\r\n throw new IModelError(stat, \"Error in bindValue\");\r\n }\r\n\r\n /** Bind an integer parameter\r\n * @param parameter Index (1-based) or name of the parameter (including the initial ':', '@' or '$')\r\n * @param val integer to bind.\r\n */\r\n public bindInteger(parameter: BindParameter, val: number) {\r\n checkBind(this.stmt.bindInteger(parameter, val));\r\n }\r\n /** Bind an integer parameter if it is defined. Otherwise do nothing.\r\n * @param parameter Index (1-based) or name of the parameter (including the initial ':', '@' or '$')\r\n * @param val integer to bind.\r\n */\r\n public maybeBindInteger(parameter: BindParameter, val?: number) {\r\n if (val !== undefined)\r\n this.bindInteger(parameter, val);\r\n }\r\n /** Bind a boolean parameter.\r\n * @param parameter Index (1-based) or name of the parameter (including the initial ':', '@' or '$')\r\n * @param val boolean to bind.\r\n */\r\n public bindBoolean(parameter: BindParameter, val: boolean) {\r\n this.bindInteger(parameter, val ? 1 : 0);\r\n }\r\n /** Bind a boolean parameter if it is defined. Otherwise do nothing.\r\n * @param parameter Index (1-based) or name of the parameter (including the initial ':', '@' or '$')\r\n * @param val boolean to bind.\r\n */\r\n public maybeBindBoolean(parameter: BindParameter, val?: boolean) {\r\n if (val !== undefined)\r\n this.bindBoolean(parameter, val);\r\n }\r\n /** JSON.stringify a property value and bind the JSON string.\r\n * @param parameter Index (1-based) or name of the parameter (including the initial ':', '@' or '$')\r\n * @param val object to bind.\r\n * @internal\r\n */\r\n public bindProps<T>(colIndex: number, val: T) {\r\n this.bindString(colIndex, JSON.stringify(val));\r\n }\r\n /** JSON.stringify a property value if it is defined, and bind the JSON string. Otherwise do nothing.\r\n * @param parameter Index (1-based) or name of the parameter (including the initial ':', '@' or '$')\r\n * @param val object to bind.\r\n * @internal\r\n */\r\n public maybeBindProps<T>(colIndex: number, val?: T) {\r\n if (val !== undefined)\r\n this.bindProps(colIndex, val);\r\n }\r\n /** Bind a double parameter\r\n * @param parameter Index (1-based) or name of the parameter (including the initial ':', '@' or '$')\r\n * @param val double to bind.\r\n */\r\n public bindDouble(parameter: BindParameter, val: number) {\r\n checkBind(this.stmt.bindDouble(parameter, val));\r\n }\r\n /** Bind a double parameter if it is defined. Otherwise do nothing.\r\n * @param parameter Index (1-based) or name of the parameter (including the initial ':', '@' or '$')\r\n * @param val double to bind.\r\n */\r\n public maybeBindDouble(parameter: BindParameter, val?: number) {\r\n if (val !== undefined)\r\n this.bindDouble(parameter, val);\r\n }\r\n /** Bind a string parameter\r\n * @param parameter Index (1-based) or name of the parameter (including the initial ':', '@' or '$')\r\n * @param val string to bind.\r\n */\r\n public bindString(parameter: BindParameter, val: string) {\r\n checkBind(this.stmt.bindString(parameter, val));\r\n }\r\n /** Bind a string parameter if it is defined. Otherwise do nothing.\r\n * @param parameter Index (1-based) or name of the parameter (including the initial ':', '@' or '$')\r\n * @param val string to bind.\r\n */\r\n public maybeBindString(parameter: BindParameter, val?: string) {\r\n if (val !== undefined)\r\n this.bindString(parameter, val);\r\n }\r\n /** Bind an Id64String parameter as a 64-bit integer\r\n * @param parameter Index (1-based) or name of the parameter (including the initial ':', '@' or '$')\r\n * @param val Id to bind.\r\n */\r\n public bindId(parameter: BindParameter, id: Id64String) {\r\n checkBind(this.stmt.bindId(parameter, id));\r\n }\r\n /** Bind a Guid parameter\r\n * @param parameter Index (1-based) or name of the parameter (including the initial ':', '@' or '$')\r\n * @param val Guid to bind.\r\n */\r\n public bindGuid(parameter: BindParameter, guid: GuidString) {\r\n checkBind(this.stmt.bindGuid(parameter, guid));\r\n }\r\n /** Bind a blob parameter\r\n * @param parameter Index (1-based) or name of the parameter (including the initial ':', '@' or '$')\r\n * @param val blob to bind.\r\n */\r\n public bindBlob(parameter: BindParameter, blob: Uint8Array) {\r\n checkBind(this.stmt.bindBlob(parameter, blob));\r\n }\r\n /** Bind a blob parameter if it is defined. Otherwise do nothing.\r\n * @param parameter Index (1-based) or name of the parameter (including the initial ':', '@' or '$')\r\n * @param val blob to bind.\r\n */\r\n public maybeBindBlob(parameter: BindParameter, val?: Uint8Array) {\r\n if (val !== undefined)\r\n this.bindBlob(parameter, val);\r\n }\r\n /** Bind null to a parameter\r\n * @param parameter Index (1-based) or name of the parameter (including the initial ':', '@' or '$')\r\n */\r\n public bindNull(parameter: BindParameter) {\r\n checkBind(this.stmt.bindNull(parameter));\r\n }\r\n\r\n /** Bind values to all parameters in the statement.\r\n * @param values The values to bind to the parameters.\r\n * Pass an *array* of values if the parameters are *positional*.\r\n * Pass an *object of the values keyed on the parameter name* for *named parameters*.\r\n * The values in either the array or object must match the respective types of the parameter.\r\n * See [[SqliteStatement.bindValue]] for details on the supported types.\r\n */\r\n public bindValues(values: any[] | object): void {\r\n if (Array.isArray(values)) {\r\n for (let i = 0; i < values.length; i++) {\r\n const paramIndex: number = i + 1;\r\n const paramValue: any = values[i];\r\n if (paramValue === undefined || paramValue === null)\r\n continue;\r\n\r\n this.bindValue(paramIndex, paramValue);\r\n }\r\n return;\r\n }\r\n\r\n for (const entry of Object.entries(values)) {\r\n const paramName: string = entry[0];\r\n const paramValue: any = entry[1];\r\n if (paramValue === undefined || paramValue === null)\r\n continue;\r\n\r\n this.bindValue(paramName, paramValue);\r\n }\r\n }\r\n\r\n /** Clear any bindings that were previously set on this statement.\r\n * @throws [IModelError]($common) in case of errors\r\n */\r\n public clearBindings(): void {\r\n const stat = this.stmt.clearBindings();\r\n if (stat !== DbResult.BE_SQLITE_OK)\r\n throw new IModelError(stat, \"Error in clearBindings\");\r\n }\r\n\r\n /** Step this statement to the next row.\r\n *\r\n * For **SQL SELECT** statements the method returns\r\n * - [DbResult.BE_SQLITE_ROW]($core-bentley) if the statement now points successfully to the next row.\r\n * - [DbResult.BE_SQLITE_DONE]($core-bentley) if the statement has no more rows.\r\n * - Error status in case of errors.\r\n *\r\n * For **SQL INSERT, UPDATE, DELETE** statements the method returns\r\n * - [DbResult.BE_SQLITE_DONE]($core-bentley) if the statement has been executed successfully.\r\n * - Error status in case of errors.\r\n */\r\n public step(): DbResult {\r\n return this.stmt.step();\r\n }\r\n /** Get the query result's column count (only for SQL SELECT statements). */\r\n public getColumnCount(): number {\r\n return this.stmt.getColumnCount();\r\n }\r\n /** Get the value for the column at the given index in the query result.\r\n * @param columnIx Index of SQL column in query result (0-based)\r\n */\r\n public getValue(columnIx: number): SqliteValue {\r\n return new SqliteValue(this.stmt, columnIx);\r\n }\r\n /** Determine whether the value of the specified column is null\r\n * @param colIndex Index of SQL column in query result (0-based)\r\n */\r\n public isValueNull(colIndex: number): boolean {\r\n return this.stmt.isValueNull(colIndex);\r\n }\r\n /** Get a size in bytes of a blob or text column\r\n * @param colIndex Index of SQL column in query result (0-based)\r\n */\r\n public getColumnBytes(colIndex: number): number {\r\n return this.stmt.getColumnBytes(colIndex);\r\n }\r\n /** Get a value as a blob\r\n * @param colIndex Index of SQL column in query result (0-based)\r\n */\r\n public getValueBlob(colIndex: number): Uint8Array {\r\n return this.stmt.getValueBlob(colIndex);\r\n }\r\n /** Get the value as a blob, or undefined if it is null.\r\n * @param colIndex Index of SQL column in query result (0-based)\r\n */\r\n public getValueBlobMaybe(colIndex: number): Uint8Array | undefined {\r\n return this.isValueNull(colIndex) ? undefined : this.getValueBlob(colIndex);\r\n }\r\n /** Get a value as a double\r\n * @param colIndex Index of SQL column in query result (0-based)\r\n */\r\n public getValueDouble(colIndex: number): number {\r\n return this.stmt.getValueDouble(colIndex);\r\n }\r\n /** Get the value as an double, or undefined if it is null.\r\n * @param colIndex Index of SQL column in query result (0-based)\r\n */\r\n public getValueDoubleMaybe(colIndex: number): number | undefined {\r\n return this.isValueNull(colIndex) ? undefined : this.getValueDouble(colIndex);\r\n }\r\n /** Get a value as a integer\r\n * @param colIndex Index of SQL column in query result (0-based)\r\n */\r\n public getValueInteger(colIndex: number): number {\r\n return this.stmt.getValueInteger(colIndex);\r\n }\r\n /** Get the value as an integer, or undefined if it is null.\r\n * @param colIndex Index of SQL column in query result (0-based)\r\n */\r\n public getValueIntegerMaybe(colIndex: number): number | undefined {\r\n return this.isValueNull(colIndex) ? undefined : this.getValueInteger(colIndex);\r\n }\r\n /** Get a value as a string\r\n * @param colIndex Index of SQL column in query result (0-based)\r\n */\r\n public getValueString(colIndex: number): string {\r\n return this.stmt.getValueString(colIndex);\r\n }\r\n /** Get the value as a string, or undefined if it is null.\r\n * @param colIndex Index of SQL column in query result (0-based)\r\n */\r\n public getValueStringMaybe(colIndex: number): string | undefined {\r\n return this.isValueNull(colIndex) ? undefined : this.getValueString(colIndex);\r\n }\r\n /** Get a value as an Id\r\n * @param colIndex Index of SQL column in query result (0-based)\r\n */\r\n public getValueId(colIndex: number): Id64String {\r\n return this.stmt.getValueId(colIndex);\r\n }\r\n /** Get a value as a Guid\r\n * @param colIndex Index of SQL column in query result (0-based)\r\n */\r\n public getValueGuid(colIndex: number): GuidString {\r\n return this.stmt.getValueGuid(colIndex);\r\n }\r\n /** Get the value as a boolean. Returns `false` if the column is null.\r\n * @param colIndex Index of SQL column in query result (0-based)\r\n */\r\n public getValueBoolean(colIndex: number) {\r\n return this.isValueNull(colIndex) ? false : 0 !== this.getValueInteger(colIndex);\r\n }\r\n /** Get the value of a [julianday](https://www.sqlite.org/lang_datefunc.html) column as a JavaScript `Date`.\r\n * @param colIndex Index of SQL column in query result (0-based)\r\n * @beta\r\n */\r\n public getValueDate(colIndex: number) {\r\n return new Date((this.stmt.getValueDouble(colIndex) - 2440587.5) * 86400000); // conversion from julian day ms to unix epoch ms\r\n }\r\n /** Get the value as a \"props\" JSON string, then parse it and return the object\r\n * @param colIndex Index of SQL column in query result (0-based)\r\n * @internal\r\n */\r\n public getProps<T>(colIndex: number): T {\r\n return JSON.parse(this.getValueString(colIndex));\r\n }\r\n /** Get the value as a \"props\" JSON string, then parse it and return the object.\r\n * If the column is null, return undefined.\r\n * @param colIndex Index of SQL column in query result (0-based)\r\n * @internal\r\n */\r\n public getPropsMaybe<T>(colIndex: number): T | undefined {\r\n return this.isValueNull(colIndex) ? undefined : this.getProps(colIndex);\r\n }\r\n\r\n /** Get the current row.\r\n * The returned row is formatted as JavaScript object where every SELECT clause item becomes a property in the JavaScript object.\r\n *\r\n * The SQL select clause item's name becomes the member name of the JavaScript object, **with the first character lowered**.\r\n *\r\n * SQLite Type | JavaScript Type\r\n * --- | ---\r\n * [SqliteValueType.Null]($backend) | undefined\r\n * [SqliteValueType.Integer]($backend) | number\r\n * [SqliteValueType.Double]($backend) | number\r\n * [SqliteValueType.String]($backend) | string\r\n * [SqliteValueType.Blob]($backend) | Uint8Array\r\n */\r\n public getRow(): any {\r\n const colCount = this.getColumnCount();\r\n const row: object = {};\r\n const duplicatePropNames = new Map<string, number>();\r\n for (let i = 0; i < colCount; i++) {\r\n const sqliteValue = this.getValue(i);\r\n if (!sqliteValue.isNull) {\r\n const propName: string = SqliteStatement.determineResultRowPropertyName(duplicatePropNames, sqliteValue);\r\n let val: any;\r\n switch (sqliteValue.type) {\r\n case SqliteValueType.Blob:\r\n val = sqliteValue.getBlob();\r\n break;\r\n case SqliteValueType.Double:\r\n val = sqliteValue.getDouble();\r\n break;\r\n case SqliteValueType.Integer:\r\n val = sqliteValue.getInteger();\r\n break;\r\n case SqliteValueType.String:\r\n val = sqliteValue.getString();\r\n break;\r\n\r\n default:\r\n throw new Error(\"Unsupported SqliteValueType\");\r\n }\r\n\r\n Object.defineProperty(row, propName, { enumerable: true, configurable: true, writable: true, value: val });\r\n }\r\n }\r\n return row;\r\n }\r\n\r\n private static determineResultRowPropertyName(duplicatePropNames: Map<string, number>, sqliteValue: SqliteValue): string {\r\n let jsName = ECJsNames.toJsName(sqliteValue.columnName);\r\n\r\n // now check duplicates. If there are, append a numeric suffix to the duplicates\r\n let suffix = duplicatePropNames.get(jsName);\r\n if (suffix === undefined)\r\n duplicatePropNames.set(jsName, 0);\r\n else {\r\n suffix++;\r\n duplicatePropNames.set(jsName, suffix);\r\n jsName += `_${suffix}`;\r\n }\r\n\r\n return jsName;\r\n }\r\n\r\n /** Calls step when called as an iterator.\r\n */\r\n public next(): IteratorResult<any> {\r\n return DbResult.BE_SQLITE_ROW === this.step() ? { done: false, value: this.getRow() } : { done: true, value: undefined };\r\n }\r\n\r\n /** The iterator that will step through the results of this statement. */\r\n public [Symbol.iterator](): IterableIterator<any> { return this; }\r\n}\r\n\r\n/** Data type of a value in in an SQLite SQL query result.\r\n * See also:\r\n * - [SqliteValue]($backend)\r\n * - [SqliteStatement]($backend)\r\n * - [SqliteStatement.getValue]($backend)\r\n * @public\r\n */\r\nexport enum SqliteValueType {\r\n // do not change the values of that enum. It must correspond to the respective\r\n // enum DbValueType in the native BeSQLite API.\r\n Integer = 1,\r\n Double = 2,\r\n String = 3,\r\n Blob = 4,\r\n Null = 5,\r\n}\r\n\r\n/** Value of a column in a row of an SQLite SQL query result.\r\n * See also:\r\n * - [SqliteStatement]($backend)\r\n * - [SqliteStatement.getValue]($backend)\r\n * @public\r\n */\r\nexport class SqliteValue {\r\n private readonly _stmt: IModelJsNative.SqliteStatement;\r\n private readonly _colIndex: number;\r\n\r\n public constructor(stmt: IModelJsNative.SqliteStatement, colIndex: number) {\r\n this._stmt = stmt;\r\n this._colIndex = colIndex;\r\n }\r\n\r\n /** Indicates whether the value is NULL or not. */\r\n public get isNull(): boolean { return this._stmt.isValueNull(this._colIndex); }\r\n\r\n /** Gets the data type of the value. */\r\n public get type(): SqliteValueType { return this._stmt.getColumnType(this._colIndex); }\r\n\r\n /** Gets the name of the column of the value. */\r\n public get columnName(): string { return this._stmt.getColumnName(this._colIndex); }\r\n\r\n /** Gets the SqlValue as JavaScript value.\r\n *\r\n * SQLite Type | JavaScript Type\r\n * --- | ---\r\n * [SqliteValueType.Null]($backend) | undefined\r\n * [SqliteValueType.Integer]($backend) | number\r\n * [SqliteValueType.Double]($backend) | number\r\n * [SqliteValueType.String]($backend) | string\r\n * [SqliteValueType.Blob]($backend) | Uint8Array\r\n */\r\n public get value(): any {\r\n switch (this.type) {\r\n case SqliteValueType.Null:\r\n return undefined;\r\n case SqliteValueType.Blob:\r\n return this.getBlob();\r\n case SqliteValueType.Double:\r\n return this.getDouble();\r\n case SqliteValueType.Integer:\r\n return this.getInteger();\r\n case SqliteValueType.String:\r\n return this.getString();\r\n default:\r\n throw new Error(\"Unhandled SqliteValueType\");\r\n }\r\n }\r\n\r\n /** Get the value as Blob */\r\n public getBlob(): Uint8Array { return this._stmt.getValueBlob(this._colIndex); }\r\n /** Get the value as a double value */\r\n public getDouble(): number { return this._stmt.getValueDouble(this._colIndex); }\r\n /** Get the value as a integer value */\r\n public getInteger(): number { return this._stmt.getValueInteger(this._colIndex); }\r\n /** Get the value as a string value */\r\n public getString(): string { return this._stmt.getValueString(this._colIndex); }\r\n /** Get the value as an Id value */\r\n public getId(): Id64String { return this._stmt.getValueId(this._colIndex); }\r\n /** Get the value as a Guid value */\r\n public getGuid(): GuidString { return this._stmt.getValueGuid(this._colIndex); }\r\n}\r\n\r\ninterface Statement {\r\n isPrepared: boolean;\r\n sql: string;\r\n dispose(): void;\r\n reset(): void;\r\n clearBindings(): void;\r\n}\r\n\r\n/** A cache for previously prepared SqliteStatements.\r\n * It only holds Statements after they are no longer in use, resetting and clearing their bindings before saving them.\r\n * When a request to use a statement from the cache is made, it is first removed from the cache.\r\n * @internal\r\n */\r\nexport class StatementCache<Stmt extends Statement> {\r\n private _cache: LRUMap<string, Stmt>;\r\n\r\n public constructor(maxCount = 40) {\r\n this._cache = new LRUMap<string, Stmt>(maxCount);\r\n }\r\n\r\n public get size() { return this._cache.size; }\r\n public addOrDispose(stmt: Stmt): void {\r\n assert(stmt.isPrepared);\r\n\r\n const existing = this._cache.get(stmt.sql);\r\n if (existing !== undefined) {\r\n stmt.dispose(); // we already have a statement with this sql cached, we can't save another one so just dispose it\r\n return;\r\n }\r\n if (this._cache.size >= this._cache.limit) {\r\n const oldest = this._cache.shift()!;\r\n oldest[1].dispose();\r\n }\r\n stmt.reset();\r\n stmt.clearBindings();\r\n this._cache.set(stmt.sql, stmt);\r\n }\r\n\r\n public findAndRemove(sql: string): Stmt | undefined {\r\n return this._cache.delete(sql);\r\n }\r\n\r\n public clear() {\r\n this._cache.forEach((stmt) => stmt.dispose());\r\n this._cache.clear();\r\n }\r\n}\r\n"]}
@@ -1,13 +1,13 @@
1
1
  /** @packageDocumentation
2
2
  * @module ViewDefinitions
3
3
  */
4
- import { Id64Array, Id64Set, Id64String } from "@itwin/core-bentley";
4
+ import { Id64Array, Id64String } from "@itwin/core-bentley";
5
5
  import { Angle, Point2d, Point3d, Range2d, Range3d, StandardViewIndex, Vector3d, YawPitchRollAngles } from "@itwin/core-geometry";
6
- import { AuxCoordSystem2dProps, AuxCoordSystem3dProps, AuxCoordSystemProps, Camera, CategorySelectorProps, Code, CodeScopeProps, LightLocationProps, ModelSelectorProps, RelatedElement, SpatialViewDefinitionProps, ViewAttachmentProps, ViewDefinition2dProps, ViewDefinition3dProps, ViewDefinitionProps, ViewDetails, ViewDetails3d } from "@itwin/core-common";
6
+ import { AuxCoordSystem2dProps, AuxCoordSystem3dProps, AuxCoordSystemProps, Camera, CategorySelectorProps, Code, CodeScopeProps, ConcreteEntityTypes, EntityReferenceSet, LightLocationProps, ModelSelectorProps, RelatedElement, SpatialViewDefinitionProps, ViewAttachmentProps, ViewDefinition2dProps, ViewDefinition3dProps, ViewDefinitionProps, ViewDetails, ViewDetails3d } from "@itwin/core-common";
7
7
  import { DefinitionElement, GraphicalElement2d, SpatialLocationElement } from "./Element";
8
- import { IModelCloneContext } from "./IModelCloneContext";
9
8
  import { IModelDb } from "./IModelDb";
10
9
  import { DisplayStyle, DisplayStyle2d, DisplayStyle3d } from "./DisplayStyle";
10
+ import { IModelElementCloneContext } from "./IModelElementCloneContext";
11
11
  /** Holds the list of Ids of GeometricModels displayed by a [[SpatialViewDefinition]]. Multiple SpatialViewDefinitions may point to the same ModelSelector.
12
12
  * @see [ModelSelectorState]($frontend)
13
13
  * See [how to create a ModelSelector]$(docs/learning/backend/CreateElements.md#ModelSelector).
@@ -23,7 +23,7 @@ export declare class ModelSelector extends DefinitionElement {
23
23
  /** @internal */
24
24
  toJSON(): ModelSelectorProps;
25
25
  /** @internal */
26
- protected collectReferenceIds(referenceIds: Id64Set): void;
26
+ protected collectReferenceConcreteIds(referenceIds: EntityReferenceSet): void;
27
27
  /** Create a Code for a ModelSelector given a name that is meant to be unique within the scope of the specified DefinitionModel.
28
28
  * @param iModel The IModelDb
29
29
  * @param scopeModelId The Id of the DefinitionModel that contains the ModelSelector and provides the scope for its name.
@@ -66,7 +66,7 @@ export declare class CategorySelector extends DefinitionElement {
66
66
  /** @internal */
67
67
  toJSON(): CategorySelectorProps;
68
68
  /** @internal */
69
- protected collectReferenceIds(referenceIds: Id64Set): void;
69
+ protected collectReferenceConcreteIds(referenceIds: EntityReferenceSet): void;
70
70
  /** Create a Code for a CategorySelector given a name that is meant to be unique within the scope of the specified DefinitionModel.
71
71
  * @param iModel The IModelDb
72
72
  * @param scopeModelId The Id of the DefinitionModel that contains the CategorySelector and provides the scope for its name.
@@ -120,11 +120,13 @@ export declare abstract class ViewDefinition extends DefinitionElement {
120
120
  /** @internal */
121
121
  toJSON(): ViewDefinitionProps;
122
122
  /** @internal */
123
- protected collectReferenceIds(referenceIds: Id64Set): void;
123
+ protected collectReferenceConcreteIds(referenceIds: EntityReferenceSet): void;
124
124
  /** @beta */
125
125
  static readonly requiredReferenceKeys: ReadonlyArray<string>;
126
+ /** @alpha */
127
+ static readonly requiredReferenceKeyTypeMap: Record<string, ConcreteEntityTypes>;
126
128
  /** @internal */
127
- protected static onCloned(context: IModelCloneContext, sourceElementProps: ViewDefinitionProps, targetElementProps: ViewDefinitionProps): void;
129
+ protected static onCloned(context: IModelElementCloneContext, sourceElementProps: ViewDefinitionProps, targetElementProps: ViewDefinitionProps): void;
128
130
  /** Type guard for `instanceof ViewDefinition3d` */
129
131
  isView3d(): this is ViewDefinition3d;
130
132
  /** Type guard for 'instanceof ViewDefinition2d` */
@@ -200,9 +202,11 @@ export declare class SpatialViewDefinition extends ViewDefinition3d {
200
202
  /** @internal */
201
203
  toJSON(): SpatialViewDefinitionProps;
202
204
  /** @internal */
203
- protected collectReferenceIds(referenceIds: Id64Set): void;
205
+ protected collectReferenceConcreteIds(referenceIds: EntityReferenceSet): void;
204
206
  /** @beta */
205
207
  static readonly requiredReferenceKeys: ReadonlyArray<string>;
208
+ /** @alpha */
209
+ static readonly requiredReferenceKeyTypeMap: Record<string, ConcreteEntityTypes>;
206
210
  /** Load this view's ModelSelector from the IModelDb. */
207
211
  loadModelSelector(): ModelSelector;
208
212
  /**
@@ -295,7 +299,7 @@ export declare class ViewDefinition2d extends ViewDefinition {
295
299
  /** @internal */
296
300
  toJSON(): ViewDefinition2dProps;
297
301
  /** @internal */
298
- protected collectReferenceIds(referenceIds: Id64Set): void;
302
+ protected collectReferenceConcreteIds(referenceIds: EntityReferenceSet): void;
299
303
  /** Provides access to optional detail settings for this view. */
300
304
  get details(): ViewDetails;
301
305
  /** Load this view's DisplayStyle2d from the IModelDb. */
@@ -420,7 +424,7 @@ export declare class ViewAttachment extends GraphicalElement2d {
420
424
  view: RelatedElement;
421
425
  constructor(props: ViewAttachmentProps, iModel: IModelDb);
422
426
  /** @internal */
423
- protected collectReferenceIds(referenceIds: Id64Set): void;
427
+ protected collectReferenceConcreteIds(referenceIds: EntityReferenceSet): void;
424
428
  }
425
429
  /** The position in space of a Light.
426
430
  * @internal
@@ -1 +1 @@
1
- {"version":3,"file":"ViewDefinition.d.ts","sourceRoot":"","sources":["../../src/ViewDefinition.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAQ,SAAS,EAAE,OAAO,EAAE,UAAU,EAA2B,MAAM,qBAAqB,CAAC;AACpG,OAAO,EACL,KAAK,EAAY,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAa,QAAQ,EAAE,kBAAkB,EAChH,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,qBAAqB,EAAE,qBAAqB,EAAE,mBAAmB,EAAe,MAAM,EACtF,qBAAqB,EAAE,IAAI,EAAE,cAAc,EAAyB,kBAAkB,EAAE,kBAAkB,EAAE,cAAc,EAC1H,0BAA0B,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,WAAW,EAAE,aAAa,EAC/I,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAC1F,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAE9E;;;;GAIG;AACH,qBAAa,aAAc,SAAQ,iBAAiB;IAClD,gBAAgB;IAChB,WAA2B,SAAS,IAAI,MAAM,CAA4B;IAE1E,mFAAmF;IAC5E,MAAM,EAAE,UAAU,EAAE,CAAC;IAC5B,gBAAgB;gBACJ,KAAK,EAAE,kBAAkB,EAAE,MAAM,EAAE,QAAQ;IAKvD,gBAAgB;IACA,MAAM,IAAI,kBAAkB;IAM5C,gBAAgB;cACG,mBAAmB,CAAC,YAAY,EAAE,OA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AAM,CAA+B;IACtE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,GAAG,EAAG,MAAM,CAAC;IACb,KAAK,EAAG,MAAM,CAAC;IACf,IAAI,EAAG,MAAM,CAAC;gBACF,KAAK,EAAE,qBAAqB,EAAE,MAAM,EAAE,QAAQ;IAEjE;;;;OAIG;WACW,UAAU,CAAC,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI;CAIlG;AAED;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,gBAAgB;IACzD,gBAAgB;IAChB,WAA2B,SAAS,IAAI,MAAM,CAAoC;IAClF;;;;OAIG;WACoB,UAAU,CAAC,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI;CAI3G;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,kBAAkB;IACpD,gBAAgB;IAChB,WAA2B,SAAS,IAAI,MAAM,CAA6B;IACpE,IAAI,EAAE,cAAc,CAAC;gBACT,KAAK,EAAE,mBAAmB,EAAE,MAAM,EAAE,QAAQ;IAK/D,gBAAgB;cACG,2BAA2B,CAAC,YAAY,EAAE,kBAAkB,GAAG,IAAI;CAIvF;AAED;;GAEG;AACH,qBAAa,aAAc,SAAQ,sBAAsB;IACvD,gBAAgB;IAChB,WAA2B,SAAS,IAAI,MAAM,CAA4B;IAC1E,iDAAiD;IAC1C,OAAO,EAAG,OAAO,CAAC;IACzB,gBAAgB;gBACJ,KAAK,EAAE,kBAAkB,EAAE,MAAM,EAAE,QAAQ;CACxD"}
@@ -33,9 +33,9 @@ class ModelSelector extends Element_1.DefinitionElement {
33
33
  return val;
34
34
  }
35
35
  /** @internal */
36
- collectReferenceIds(referenceIds) {
37
- super.collectReferenceIds(referenceIds);
38
- this.models.forEach((modelId) => referenceIds.add(modelId));
36
+ collectReferenceConcreteIds(referenceIds) {
37
+ super.collectReferenceConcreteIds(referenceIds);
38
+ this.models.forEach((modelId) => referenceIds.addModel(modelId));
39
39
  }
40
40
  /** Create a Code for a ModelSelector given a name that is meant to be unique within the scope of the specified DefinitionModel.
41
41
  * @param iModel The IModelDb
@@ -100,9 +100,9 @@ class CategorySelector extends Element_1.DefinitionElement {
100
100
  return val;
101
101
  }
102
102
  /** @internal */
103
- collectReferenceIds(referenceIds) {
104
- super.collectReferenceIds(referenceIds);
105
- this.categories.forEach((categoryId) => referenceIds.add(categoryId));
103
+ collectReferenceConcreteIds(referenceIds) {
104
+ super.collectReferenceConcreteIds(referenceIds);
105
+ this.categories.forEach((categoryId) => referenceIds.addElement(categoryId));
106
106
  }
107
107
  /** Create a Code for a CategorySelector given a name that is meant to be unique within the scope of the specified DefinitionModel.
108
108
  * @param iModel The IModelDb
@@ -182,13 +182,13 @@ class ViewDefinition extends (_b = Element_1.DefinitionElement) {
182
182
  return json;
183
183
  }
184
184
  /** @internal */
185
- collectReferenceIds(referenceIds) {
186
- super.collectReferenceIds(referenceIds);
187
- referenceIds.add(this.categorySelectorId);
188
- referenceIds.add(this.displayStyleId);
185
+ collectReferenceConcreteIds(referenceIds) {
186
+ super.collectReferenceConcreteIds(referenceIds);
187
+ referenceIds.addElement(this.categorySelectorId);
188
+ referenceIds.addElement(this.displayStyleId);
189
189
  const acsId = this.getAuxiliaryCoordinateSystemId();
190
190
  if (core_bentley_1.Id64.isValidId64(acsId)) {
191
- referenceIds.add(acsId);
191
+ referenceIds.addElement(acsId);
192
192
  }
193
193
  }
194
194
  /** @internal */
@@ -237,6 +237,12 @@ exports.ViewDefinition = ViewDefinition;
237
237
  _a = ViewDefinition;
238
238
  /** @beta */
239
239
  ViewDefinition.requiredReferenceKeys = [...Reflect.get(_b, "requiredReferenceKeys", _a), "categorySelectorId", "displayStyleId"];
240
+ /** @alpha */
241
+ ViewDefinition.requiredReferenceKeyTypeMap = {
242
+ ...Reflect.get(_b, "requiredReferenceKeyTypeMap", _a),
243
+ categorySelectorId: core_common_1.ConcreteEntityTypes.Element,
244
+ displayStyleId: core_common_1.ConcreteEntityTypes.Element,
245
+ };
240
246
  /** Defines a view of one or more 3d models.
241
247
  * @public
242
248
  */
@@ -298,9 +304,9 @@ class SpatialViewDefinition extends (_d = ViewDefinition3d) {
298
304
  return json;
299
305
  }
300
306
  /** @internal */
301
- collectReferenceIds(referenceIds) {
302
- super.collectReferenceIds(referenceIds);
303
- referenceIds.add(this.modelSelectorId);
307
+ collectReferenceConcreteIds(referenceIds) {
308
+ super.collectReferenceConcreteIds(referenceIds);
309
+ referenceIds.addElement(this.modelSelectorId);
304
310
  }
305
311
  /** Load this view's ModelSelector from the IModelDb. */
306
312
  loadModelSelector() { return this.iModel.elements.getElement(this.modelSelectorId); }
@@ -365,6 +371,11 @@ exports.SpatialViewDefinition = SpatialViewDefinition;
365
371
  _c = SpatialViewDefinition;
366
372
  /** @beta */
367
373
  SpatialViewDefinition.requiredReferenceKeys = [...Reflect.get(_d, "requiredReferenceKeys", _c), "modelSelectorId"];
374
+ /** @alpha */
375
+ SpatialViewDefinition.requiredReferenceKeyTypeMap = {
376
+ ...Reflect.get(_d, "requiredReferenceKeyTypeMap", _c),
377
+ modelSelectorId: core_common_1.ConcreteEntityTypes.Element,
378
+ };
368
379
  /** Defines a spatial view that displays geometry on the image plane using a parallel orthographic projection.
369
380
  * See [how to create a OrthographicViewDefinition]$(docs/learning/backend/CreateElements.md#OrthographicViewDefinition).
370
381
  * @public
@@ -458,9 +469,9 @@ class ViewDefinition2d extends ViewDefinition {
458
469
  return val;
459
470
  }
460
471
  /** @internal */
461
- collectReferenceIds(referenceIds) {
462
- super.collectReferenceIds(referenceIds);
463
- referenceIds.add(this.baseModelId);
472
+ collectReferenceConcreteIds(referenceIds) {
473
+ super.collectReferenceConcreteIds(referenceIds);
474
+ referenceIds.addElement(this.baseModelId);
464
475
  }
465
476
  /** Provides access to optional detail settings for this view. */
466
477
  get details() { return this._details; }
@@ -617,9 +628,9 @@ class ViewAttachment extends Element_1.GraphicalElement2d {
617
628
  /** @internal */
618
629
  static get className() { return "ViewAttachment"; }
619
630
  /** @internal */
620
- collectReferenceIds(referenceIds) {
621
- super.collectReferenceIds(referenceIds);
622
- referenceIds.add(this.view.id);
631
+ collectReferenceConcreteIds(referenceIds) {
632
+ super.collectReferenceConcreteIds(referenceIds);
633
+ referenceIds.addElement(this.view.id);
623
634
  }
624
635
  }
625
636
  exports.ViewAttachment = ViewAttachment;