@itwin/core-backend 5.1.0-dev.64 → 5.1.0-dev.66

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 (82) hide show
  1. package/lib/cjs/BisCoreSchema.d.ts.map +1 -1
  2. package/lib/cjs/BisCoreSchema.js +3 -1
  3. package/lib/cjs/BisCoreSchema.js.map +1 -1
  4. package/lib/cjs/Entity.d.ts +2 -0
  5. package/lib/cjs/Entity.d.ts.map +1 -1
  6. package/lib/cjs/Entity.js +14 -0
  7. package/lib/cjs/Entity.js.map +1 -1
  8. package/lib/cjs/IModelDb.d.ts +6 -2
  9. package/lib/cjs/IModelDb.d.ts.map +1 -1
  10. package/lib/cjs/IModelDb.js +12 -5
  11. package/lib/cjs/IModelDb.js.map +1 -1
  12. package/lib/cjs/annotations/ElementDrivesTextAnnotation.d.ts +61 -0
  13. package/lib/cjs/annotations/ElementDrivesTextAnnotation.d.ts.map +1 -0
  14. package/lib/cjs/annotations/ElementDrivesTextAnnotation.js +110 -0
  15. package/lib/cjs/annotations/ElementDrivesTextAnnotation.js.map +1 -0
  16. package/lib/cjs/annotations/TextAnnotationElement.d.ts +18 -1
  17. package/lib/cjs/annotations/TextAnnotationElement.d.ts.map +1 -1
  18. package/lib/cjs/annotations/TextAnnotationElement.js +57 -2
  19. package/lib/cjs/annotations/TextAnnotationElement.js.map +1 -1
  20. package/lib/cjs/annotations/TextAnnotationGeometry.js +1 -0
  21. package/lib/cjs/annotations/TextAnnotationGeometry.js.map +1 -1
  22. package/lib/cjs/annotations/TextBlockGeometry.d.ts.map +1 -1
  23. package/lib/cjs/annotations/TextBlockGeometry.js +15 -1
  24. package/lib/cjs/annotations/TextBlockGeometry.js.map +1 -1
  25. package/lib/cjs/annotations/TextBlockLayout.d.ts +2 -2
  26. package/lib/cjs/annotations/TextBlockLayout.d.ts.map +1 -1
  27. package/lib/cjs/annotations/TextBlockLayout.js +14 -2
  28. package/lib/cjs/annotations/TextBlockLayout.js.map +1 -1
  29. package/lib/cjs/core-backend.d.ts +1 -0
  30. package/lib/cjs/core-backend.d.ts.map +1 -1
  31. package/lib/cjs/core-backend.js +1 -0
  32. package/lib/cjs/core-backend.js.map +1 -1
  33. package/lib/cjs/internal/annotations/fields.d.ts +22 -0
  34. package/lib/cjs/internal/annotations/fields.d.ts.map +1 -0
  35. package/lib/cjs/internal/annotations/fields.js +237 -0
  36. package/lib/cjs/internal/annotations/fields.js.map +1 -0
  37. package/lib/esm/BisCoreSchema.d.ts.map +1 -1
  38. package/lib/esm/BisCoreSchema.js +3 -1
  39. package/lib/esm/BisCoreSchema.js.map +1 -1
  40. package/lib/esm/Entity.d.ts +2 -0
  41. package/lib/esm/Entity.d.ts.map +1 -1
  42. package/lib/esm/Entity.js +14 -0
  43. package/lib/esm/Entity.js.map +1 -1
  44. package/lib/esm/IModelDb.d.ts +6 -2
  45. package/lib/esm/IModelDb.d.ts.map +1 -1
  46. package/lib/esm/IModelDb.js +13 -6
  47. package/lib/esm/IModelDb.js.map +1 -1
  48. package/lib/esm/annotations/ElementDrivesTextAnnotation.d.ts +61 -0
  49. package/lib/esm/annotations/ElementDrivesTextAnnotation.d.ts.map +1 -0
  50. package/lib/esm/annotations/ElementDrivesTextAnnotation.js +105 -0
  51. package/lib/esm/annotations/ElementDrivesTextAnnotation.js.map +1 -0
  52. package/lib/esm/annotations/TextAnnotationElement.d.ts +18 -1
  53. package/lib/esm/annotations/TextAnnotationElement.d.ts.map +1 -1
  54. package/lib/esm/annotations/TextAnnotationElement.js +57 -2
  55. package/lib/esm/annotations/TextAnnotationElement.js.map +1 -1
  56. package/lib/esm/annotations/TextAnnotationGeometry.js +1 -0
  57. package/lib/esm/annotations/TextAnnotationGeometry.js.map +1 -1
  58. package/lib/esm/annotations/TextBlockGeometry.d.ts.map +1 -1
  59. package/lib/esm/annotations/TextBlockGeometry.js +15 -1
  60. package/lib/esm/annotations/TextBlockGeometry.js.map +1 -1
  61. package/lib/esm/annotations/TextBlockLayout.d.ts +2 -2
  62. package/lib/esm/annotations/TextBlockLayout.d.ts.map +1 -1
  63. package/lib/esm/annotations/TextBlockLayout.js +14 -2
  64. package/lib/esm/annotations/TextBlockLayout.js.map +1 -1
  65. package/lib/esm/core-backend.d.ts +1 -0
  66. package/lib/esm/core-backend.d.ts.map +1 -1
  67. package/lib/esm/core-backend.js +1 -0
  68. package/lib/esm/core-backend.js.map +1 -1
  69. package/lib/esm/internal/annotations/fields.d.ts +22 -0
  70. package/lib/esm/internal/annotations/fields.d.ts.map +1 -0
  71. package/lib/esm/internal/annotations/fields.js +231 -0
  72. package/lib/esm/internal/annotations/fields.js.map +1 -0
  73. package/lib/esm/test/IModelTestUtils.d.ts.map +1 -1
  74. package/lib/esm/test/IModelTestUtils.js +1 -0
  75. package/lib/esm/test/IModelTestUtils.js.map +1 -1
  76. package/lib/esm/test/annotations/Fields.test.d.ts +2 -0
  77. package/lib/esm/test/annotations/Fields.test.d.ts.map +1 -0
  78. package/lib/esm/test/annotations/Fields.test.js +576 -0
  79. package/lib/esm/test/annotations/Fields.test.js.map +1 -0
  80. package/lib/esm/test/annotations/TextAnnotation.test.js.map +1 -1
  81. package/lib/esm/test/annotations/TextBlock.test.js.map +1 -1
  82. package/package.json +14 -14
@@ -45,7 +45,7 @@ import { IModelNative } from "./internal/NativePlatform";
45
45
  import { createNoOpLockControl } from "./internal/NoLocks";
46
46
  import { createIModelDbFonts } from "./internal/IModelDbFontsImpl";
47
47
  import { _cache, _close, _hubAccess, _instanceKeyCache, _nativeDb, _releaseAllLocks } from "./internal/Symbols";
48
- import { SchemaContext, SchemaJsonLocater } from "@itwin/ecschema-metadata";
48
+ import { ECVersion, SchemaContext, SchemaJsonLocater } from "@itwin/ecschema-metadata";
49
49
  import { SchemaMap } from "./Schema";
50
50
  import { ElementLRUCache, InstanceKeyLRUCache } from "./internal/ElementLRUCache";
51
51
  // spell:ignore fontid fontmap
@@ -1155,19 +1155,26 @@ export class IModelDb extends IModel {
1155
1155
  const classNameParts = classFullName.replace(".", ":").split(":");
1156
1156
  return classNameParts.length === 2 && this[_nativeDb].getECClassMetaData(classNameParts[0], classNameParts[1]).error === undefined;
1157
1157
  }
1158
- /** Query for a schema of the specified name in this iModel.
1158
+ /** Query the version of a schema of the specified name in this iModel.
1159
1159
  * @returns The schema version as a semver-compatible string or `undefined` if the schema has not been imported.
1160
1160
  */
1161
1161
  querySchemaVersion(schemaName) {
1162
+ const version = this.querySchemaVersionNumbers(schemaName);
1163
+ return version?.toString(false);
1164
+ }
1165
+ /** Query the version of a schema of the specified name in this iModel.
1166
+ * @returns the version numbers, or `undefined` if the schema has not been imported.
1167
+ */
1168
+ querySchemaVersionNumbers(schemaName) {
1162
1169
  const sql = `SELECT VersionMajor,VersionWrite,VersionMinor FROM ECDbMeta.ECSchemaDef WHERE Name=:schemaName LIMIT 1`;
1163
1170
  // eslint-disable-next-line @typescript-eslint/no-deprecated
1164
1171
  return this.withPreparedStatement(sql, (statement) => {
1165
1172
  statement.bindString("schemaName", schemaName);
1166
1173
  if (DbResult.BE_SQLITE_ROW === statement.step()) {
1167
- const versionMajor = statement.getValue(0).getInteger(); // ECSchemaDef.VersionMajor --> semver.major
1168
- const versionWrite = statement.getValue(1).getInteger(); // ECSchemaDef.VersionWrite --> semver.minor
1169
- const versionMinor = statement.getValue(2).getInteger(); // ECSchemaDef.VersionMinor --> semver.patch
1170
- return `${versionMajor}.${versionWrite}.${versionMinor}`;
1174
+ const read = statement.getValue(0).getInteger(); // ECSchemaDef.VersionMajor --> semver.major
1175
+ const write = statement.getValue(1).getInteger(); // ECSchemaDef.VersionWrite --> semver.minor
1176
+ const minor = statement.getValue(2).getInteger(); // ECSchemaDef.VersionMinor --> semver.patch
1177
+ return new ECVersion(read, write, minor);
1171
1178
  }
1172
1179
  return undefined;
1173
1180
  });