@itwin/core-backend 5.6.0-dev.8 → 5.7.0-dev.2

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/CHANGELOG.md +11 -1
  2. package/lib/cjs/BriefcaseManager.d.ts.map +1 -1
  3. package/lib/cjs/BriefcaseManager.js +37 -14
  4. package/lib/cjs/BriefcaseManager.js.map +1 -1
  5. package/lib/cjs/IModelDb.d.ts +33 -24
  6. package/lib/cjs/IModelDb.d.ts.map +1 -1
  7. package/lib/cjs/IModelDb.js +42 -4
  8. package/lib/cjs/IModelDb.js.map +1 -1
  9. package/lib/cjs/SQLiteDb.d.ts.map +1 -1
  10. package/lib/cjs/SQLiteDb.js +0 -1
  11. package/lib/cjs/SQLiteDb.js.map +1 -1
  12. package/lib/cjs/SqliteChangesetReader.d.ts +5 -0
  13. package/lib/cjs/SqliteChangesetReader.d.ts.map +1 -1
  14. package/lib/cjs/SqliteChangesetReader.js +7 -0
  15. package/lib/cjs/SqliteChangesetReader.js.map +1 -1
  16. package/lib/cjs/StashManager.d.ts +1 -2
  17. package/lib/cjs/StashManager.d.ts.map +1 -1
  18. package/lib/cjs/StashManager.js.map +1 -1
  19. package/lib/cjs/TxnManager.d.ts +74 -52
  20. package/lib/cjs/TxnManager.d.ts.map +1 -1
  21. package/lib/cjs/TxnManager.js +114 -26
  22. package/lib/cjs/TxnManager.js.map +1 -1
  23. package/lib/cjs/annotations/TextAnnotationElement.d.ts +1 -1
  24. package/lib/cjs/annotations/TextAnnotationElement.d.ts.map +1 -1
  25. package/lib/cjs/annotations/TextAnnotationElement.js +14 -1
  26. package/lib/cjs/annotations/TextAnnotationElement.js.map +1 -1
  27. package/lib/cjs/annotations/TextAnnotationGeometry.d.ts +14 -0
  28. package/lib/cjs/annotations/TextAnnotationGeometry.d.ts.map +1 -1
  29. package/lib/cjs/annotations/TextAnnotationGeometry.js +29 -10
  30. package/lib/cjs/annotations/TextAnnotationGeometry.js.map +1 -1
  31. package/lib/cjs/annotations/TextBlockLayout.js +6 -6
  32. package/lib/cjs/annotations/TextBlockLayout.js.map +1 -1
  33. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.d.ts.map +1 -1
  34. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
  35. package/lib/esm/BriefcaseManager.d.ts.map +1 -1
  36. package/lib/esm/BriefcaseManager.js +37 -14
  37. package/lib/esm/BriefcaseManager.js.map +1 -1
  38. package/lib/esm/IModelDb.d.ts +33 -24
  39. package/lib/esm/IModelDb.d.ts.map +1 -1
  40. package/lib/esm/IModelDb.js +42 -4
  41. package/lib/esm/IModelDb.js.map +1 -1
  42. package/lib/esm/SQLiteDb.d.ts.map +1 -1
  43. package/lib/esm/SQLiteDb.js +0 -1
  44. package/lib/esm/SQLiteDb.js.map +1 -1
  45. package/lib/esm/SqliteChangesetReader.d.ts +5 -0
  46. package/lib/esm/SqliteChangesetReader.d.ts.map +1 -1
  47. package/lib/esm/SqliteChangesetReader.js +7 -0
  48. package/lib/esm/SqliteChangesetReader.js.map +1 -1
  49. package/lib/esm/StashManager.d.ts +1 -2
  50. package/lib/esm/StashManager.d.ts.map +1 -1
  51. package/lib/esm/StashManager.js.map +1 -1
  52. package/lib/esm/TxnManager.d.ts +74 -52
  53. package/lib/esm/TxnManager.d.ts.map +1 -1
  54. package/lib/esm/TxnManager.js +114 -26
  55. package/lib/esm/TxnManager.js.map +1 -1
  56. package/lib/esm/annotations/TextAnnotationElement.d.ts +1 -1
  57. package/lib/esm/annotations/TextAnnotationElement.d.ts.map +1 -1
  58. package/lib/esm/annotations/TextAnnotationElement.js +14 -1
  59. package/lib/esm/annotations/TextAnnotationElement.js.map +1 -1
  60. package/lib/esm/annotations/TextAnnotationGeometry.d.ts +14 -0
  61. package/lib/esm/annotations/TextAnnotationGeometry.d.ts.map +1 -1
  62. package/lib/esm/annotations/TextAnnotationGeometry.js +29 -10
  63. package/lib/esm/annotations/TextAnnotationGeometry.js.map +1 -1
  64. package/lib/esm/annotations/TextBlockLayout.js +6 -6
  65. package/lib/esm/annotations/TextBlockLayout.js.map +1 -1
  66. package/lib/esm/rpc-impl/RpcBriefcaseUtility.d.ts.map +1 -1
  67. package/lib/esm/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
  68. package/lib/esm/test/annotations/LeaderGeometry.test.js +2 -3
  69. package/lib/esm/test/annotations/LeaderGeometry.test.js.map +1 -1
  70. package/lib/esm/test/annotations/TextAnnotation.test.js +39 -4
  71. package/lib/esm/test/annotations/TextAnnotation.test.js.map +1 -1
  72. package/lib/esm/test/annotations/TextBlock.test.js +49 -42
  73. package/lib/esm/test/annotations/TextBlock.test.js.map +1 -1
  74. package/lib/esm/test/hubaccess/Rebase.test.js +546 -22
  75. package/lib/esm/test/hubaccess/Rebase.test.js.map +1 -1
  76. package/lib/esm/test/imodel/SchemaXmlImport.test.js +87 -44
  77. package/lib/esm/test/imodel/SchemaXmlImport.test.js.map +1 -1
  78. package/lib/esm/test/schema/SchemaImportCallbacks.test.js +4 -4
  79. package/lib/esm/test/schema/SchemaImportCallbacks.test.js.map +1 -1
  80. package/lib/esm/test/standalone/ChangeMerge.test.js +9 -9
  81. package/lib/esm/test/standalone/ChangeMerge.test.js.map +1 -1
  82. package/package.json +14 -14
@@ -9,65 +9,108 @@ import { PhysicalElement, SnapshotDb } from "../../core-backend";
9
9
  import { IModelTestUtils } from "../IModelTestUtils";
10
10
  import { Logger, LogLevel } from "@itwin/core-bentley";
11
11
  import { KnownTestLocations } from "../KnownTestLocations";
12
- import { EntityClass } from "@itwin/ecschema-metadata";
12
+ import { EntityClass, Format } from "@itwin/ecschema-metadata";
13
13
  describe("Schema XML Import Tests", () => {
14
- let imodel;
15
14
  before(() => {
16
15
  // initialize logging
17
16
  if (false) {
18
17
  Logger.initializeToConsole();
19
18
  Logger.setLevelDefault(LogLevel.Error);
20
19
  }
21
- const testFileName = IModelTestUtils.prepareOutputFile("SchemaXMLImport", "SchemaXMLImport.bim");
22
- imodel = SnapshotDb.createEmpty(testFileName, { rootSubject: { name: "SchemaXMLImportTest" } }); // IModelTestUtils.createSnapshotFromSeed(testFileName, seedFileName);
23
- assert.exists(imodel);
24
- });
25
- after(() => {
26
- if (imodel)
27
- imodel.close();
28
20
  });
29
21
  it("should import schema XML", async () => {
30
- const schemaFilePath = path.join(KnownTestLocations.assetsDir, "Test3.ecschema.xml");
31
- const schemaString = fs.readFileSync(schemaFilePath, "utf8");
32
- await imodel.importSchemaStrings([schemaString]); // will throw an exception if import fails
33
- const testDomainClass = await imodel.schemaContext.getSchemaItem("Test3.Test3Element", EntityClass);
34
- assert.isDefined(testDomainClass);
35
- assert.isDefined(testDomainClass?.baseClass);
36
- assert.equal(testDomainClass?.baseClass?.fullName, PhysicalElement.classFullName.replace(":", "."));
22
+ const testFileName = IModelTestUtils.prepareOutputFile("SchemaXMLImport", "SchemaXMLImport.bim");
23
+ const imodel = SnapshotDb.createEmpty(testFileName, { rootSubject: { name: "SchemaXMLImportTest" } });
24
+ try {
25
+ const schemaFilePath = path.join(KnownTestLocations.assetsDir, "Test3.ecschema.xml");
26
+ const schemaString = fs.readFileSync(schemaFilePath, "utf8");
27
+ await imodel.importSchemaStrings([schemaString]); // will throw an exception if import fails
28
+ const testDomainClass = await imodel.schemaContext.getSchemaItem("Test3.Test3Element", EntityClass);
29
+ assert.isDefined(testDomainClass);
30
+ assert.isDefined(testDomainClass?.baseClass);
31
+ assert.equal(testDomainClass?.baseClass?.fullName, PhysicalElement.classFullName.replace(":", "."));
32
+ }
33
+ finally {
34
+ imodel.close();
35
+ }
37
36
  });
38
37
  it("Schema import for newer ECXml Versions", async () => {
39
- const helperFunction = async (imodelDb, xmlSchema, importSchema) => {
40
- try {
41
- // ECObjects is expected to throw for schemas that fail to import
42
- if (importSchema)
43
- await imodelDb.importSchemaStrings(xmlSchema);
44
- else
45
- imodelDb.getSchemaProps(xmlSchema[0]);
38
+ const testFileName = IModelTestUtils.prepareOutputFile("SchemaXMLImport", "SchemaVersionTest.bim");
39
+ const imodel = SnapshotDb.createEmpty(testFileName, { rootSubject: { name: "SchemaVersionTest" } });
40
+ try {
41
+ const helperFunction = async (imodelDb, xmlSchema, importSchema) => {
42
+ try {
43
+ // ECObjects is expected to throw for schemas that fail to import
44
+ if (importSchema)
45
+ await imodelDb.importSchemaStrings(xmlSchema);
46
+ else
47
+ imodelDb.getSchemaProps(xmlSchema[0]);
48
+ }
49
+ catch {
50
+ return false;
51
+ }
52
+ return true;
53
+ };
54
+ // Incrementing major ECXml version is not supported
55
+ for (const testCase of [`4.1`, `5.10`]) {
56
+ assert(!(await helperFunction(imodel, [`<ECSchema schemaName="TestSchema" alias="ts" version="1.0.0" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.${testCase}"/>`], true)), `Schema ${testCase} import should not have succeeded.`);
57
+ assert(!(await helperFunction(imodel, [`TestSchema`], false)), `Schema ${testCase} test should not have succeeded.`);
58
+ }
59
+ // Importing a set of schemas should all fail if any one of them fails
60
+ {
61
+ const schemaXmls = [`<ECSchema schemaName="TestSchema1" alias="ts1" version="1.0.0" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.2"/>`,
62
+ `<ECSchema schemaName="TestSchema2" alias="ts2" version="1.0.0" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.8"/>`,
63
+ `<ECSchema schemaName="TestSchema3" alias="ts3" version="1.0.0" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.4.5"/>`];
64
+ assert(!(await helperFunction(imodel, schemaXmls, true)), `Schema import should not have succeeded.`);
65
+ assert(!(await helperFunction(imodel, [`TestSchema1`], false)), `Schema TestSchema1 import should not have succeeded.`);
66
+ assert(!(await helperFunction(imodel, [`TestSchema2`], false)), `Schema TestSchema2 import should not have succeeded.`);
67
+ assert(!(await helperFunction(imodel, [`TestSchema3`], false)), `Schema TestSchema3 import should not have succeeded.`);
46
68
  }
47
- catch {
48
- return false;
69
+ // Schema should be imported successfully
70
+ for (const testCase of [`3.2`, `3.5`]) {
71
+ assert(await helperFunction(imodel, [`<ECSchema schemaName="TestSchema" alias="ts" version="1.0.0" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.${testCase}"/>`], true), `Schema ${testCase} import should have succeeded.`);
72
+ assert(await helperFunction(imodel, [`TestSchema`], false), `Schema ${testCase} test should have succeeded.`);
49
73
  }
50
- return true;
51
- };
52
- // Incrementing major ECXml version is not supported
53
- for (const testCase of [`4.1`, `5.10`]) {
54
- assert(!(await helperFunction(imodel, [`<ECSchema schemaName="TestSchema" alias="ts" version="1.0.0" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.${testCase}"/>`], true)), `Schema ${testCase} import should not have succeeded.`);
55
- assert(!(await helperFunction(imodel, [`TestSchema`], false)), `Schema ${testCase} test should not have succeeded.`);
56
74
  }
57
- // Importing a set of schemas should all fail if any one of them fails
58
- {
59
- const schemaXmls = [`<ECSchema schemaName="TestSchema1" alias="ts1" version="1.0.0" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.2"/>`,
60
- `<ECSchema schemaName="TestSchema2" alias="ts2" version="1.0.0" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.8"/>`,
61
- `<ECSchema schemaName="TestSchema3" alias="ts3" version="1.0.0" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.4.5"/>`];
62
- assert(!(await helperFunction(imodel, schemaXmls, true)), `Schema import should not have succeeded.`);
63
- assert(!(await helperFunction(imodel, [`TestSchema1`], false)), `Schema TestSchema1 import should not have succeeded.`);
64
- assert(!(await helperFunction(imodel, [`TestSchema2`], false)), `Schema TestSchema2 import should not have succeeded.`);
65
- assert(!(await helperFunction(imodel, [`TestSchema3`], false)), `Schema TestSchema3 import should not have succeeded.`);
75
+ finally {
76
+ imodel.close();
77
+ }
78
+ });
79
+ it.skip("should roundtrip ratio format properties", async () => {
80
+ // Create a separate iModel for this test
81
+ const testFileName = IModelTestUtils.prepareOutputFile("SchemaXMLImport", "RatioFormatRoundtrip.bim");
82
+ const testIModel = SnapshotDb.createEmpty(testFileName, { rootSubject: { name: "RatioFormatTest" } });
83
+ try {
84
+ const schemaXml = `<?xml version="1.0" encoding="UTF-8"?>
85
+ <ECSchema schemaName="RatioFormatTest" alias="rft" version="01.00.00" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.2">
86
+ <ECSchemaReference name="Units" version="01.00.09" alias="u"/>
87
+ <Format typeName="TestRatioFormat" type="Ratio" ratioType="OneToN" ratioSeparator=":" ratioFormatType="Decimal" precision="4" formatTraits="trailZeroes|showUnitLabel">
88
+ <Composite>
89
+ <Unit>u:M</Unit>
90
+ </Composite>
91
+ </Format>
92
+ <Format typeName="TestRatioFormat2" type="Ratio" ratioType="NToOne" ratioSeparator="=" ratioFormatType="Fractional" precision="8" formatTraits="keepSingleZero">
93
+ <Composite>
94
+ <Unit>u:M</Unit>
95
+ </Composite>
96
+ </Format>
97
+ </ECSchema>`;
98
+ // Import schema into iModel
99
+ await testIModel.importSchemaStrings([schemaXml]);
100
+ // Read back the format from the iModel's schema context
101
+ const format1 = await testIModel.schemaContext.getSchemaItem("RatioFormatTest.TestRatioFormat", Format);
102
+ assert.isDefined(format1);
103
+ assert.strictEqual(format1?.ratioType, "OneToN");
104
+ assert.strictEqual(format1?.ratioSeparator, ":");
105
+ assert.strictEqual(format1?.ratioFormatType, "Decimal");
106
+ const format2 = await testIModel.schemaContext.getSchemaItem("RatioFormatTest.TestRatioFormat2", Format);
107
+ assert.isDefined(format2);
108
+ assert.strictEqual(format2?.ratioType, "NToOne");
109
+ assert.strictEqual(format2?.ratioSeparator, "=");
110
+ assert.strictEqual(format2?.ratioFormatType, "Fractional");
66
111
  }
67
- // Schema should be imported successfully
68
- for (const testCase of [`3.2`, `3.5`]) {
69
- assert(await helperFunction(imodel, [`<ECSchema schemaName="TestSchema" alias="ts" version="1.0.0" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.${testCase}"/>`], true), `Schema ${testCase} import should have succeeded.`);
70
- assert(await helperFunction(imodel, [`TestSchema`], false), `Schema ${testCase} test should have succeeded.`);
112
+ finally {
113
+ testIModel.close();
71
114
  }
72
115
  });
73
116
  });
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaXmlImport.test.js","sourceRoot":"","sources":["../../../../src/test/imodel/SchemaXmlImport.test.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,QAAQ,CAAC,yBAAyB,EAAE,GAAG,EAAE;IACvC,IAAI,MAAkB,CAAC;IAEvB,MAAM,CAAC,GAAG,EAAE;QACV,qBAAqB;QACrB,IAAI,KAAK,EAAE,CAAC;YACV,MAAM,CAAC,mBAAmB,EAAE,CAAC;YAC7B,MAAM,CAAC,eAAe,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QACzC,CAAC;QACD,MAAM,YAAY,GAAG,eAAe,CAAC,iBAAiB,CAAC,iBAAiB,EAAE,qBAAqB,CAAC,CAAC;QACjG,MAAM,GAAG,UAAU,CAAC,WAAW,CAAC,YAAY,EAAE,EAAE,WAAW,EAAE,EAAE,IAAI,EAAE,qBAAqB,EAAE,EAAE,CAAC,CAAC,CAAC,sEAAsE;QACvK,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACxB,CAAC,CAAC,CAAC;IAEH,KAAK,CAAC,GAAG,EAAE;QACT,IAAI,M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CAAC,YAAY,CAAC,EAAE,KAAK,CAAC,EAAE,UAAU,QAAQ,8BAA8B,CAAC,CAAC;QAChH,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","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\nimport { assert } from \"chai\";\r\nimport * as fs from \"fs\";\r\nimport * as path from \"path\";\r\nimport { PhysicalElement, SnapshotDb } from \"../../core-backend\";\r\nimport { IModelTestUtils } from \"../IModelTestUtils\";\r\nimport { Logger, LogLevel } from \"@itwin/core-bentley\";\r\nimport { KnownTestLocations } from \"../KnownTestLocations\";\r\nimport { EntityClass } from \"@itwin/ecschema-metadata\";\r\n\r\ndescribe(\"Schema XML Import Tests\", () => {\r\n let imodel: SnapshotDb;\r\n\r\n before(() => {\r\n // initialize logging\r\n if (false) {\r\n Logger.initializeToConsole();\r\n Logger.setLevelDefault(LogLevel.Error);\r\n }\r\n const testFileName = IModelTestUtils.prepareOutputFile(\"SchemaXMLImport\", \"SchemaXMLImport.bim\");\r\n imodel = SnapshotDb.createEmpty(testFileName, { rootSubject: { name: \"SchemaXMLImportTest\" } }); // IModelTestUtils.createSnapshotFromSeed(testFileName, seedFileName);\r\n assert.exists(imodel);\r\n });\r\n\r\n after(() => {\r\n if (imodel)\r\n imodel.close();\r\n });\r\n\r\n it(\"should import schema XML\", async () => {\r\n const schemaFilePath = path.join(KnownTestLocations.assetsDir, \"Test3.ecschema.xml\");\r\n const schemaString = fs.readFileSync(schemaFilePath, \"utf8\");\r\n\r\n await imodel.importSchemaStrings([schemaString]); // will throw an exception if import fails\r\n\r\n const testDomainClass = await imodel.schemaContext.getSchemaItem(\"Test3.Test3Element\", EntityClass);\r\n assert.isDefined(testDomainClass);\r\n\r\n assert.isDefined(testDomainClass?.baseClass);\r\n\r\n assert.equal(testDomainClass?.baseClass?.fullName, PhysicalElement.classFullName.replace(\":\", \".\"));\r\n });\r\n\r\n it(\"Schema import for newer ECXml Versions\", async () => {\r\n const helperFunction = async (imodelDb: SnapshotDb, xmlSchema: string[], importSchema: boolean) => {\r\n try {\r\n // ECObjects is expected to throw for schemas that fail to import\r\n if (importSchema)\r\n await imodelDb.importSchemaStrings(xmlSchema);\r\n else\r\n imodelDb.getSchemaProps(xmlSchema[0]);\r\n } catch {\r\n return false;\r\n }\r\n return true;\r\n };\r\n\r\n // Incrementing major ECXml version is not supported\r\n for (const testCase of [`4.1`, `5.10`]) {\r\n assert(!(await helperFunction(imodel, [`<ECSchema schemaName=\"TestSchema\" alias=\"ts\" version=\"1.0.0\" xmlns=\"http://www.bentley.com/schemas/Bentley.ECXML.${testCase}\"/>`], true)), `Schema ${testCase} import should not have succeeded.`);\r\n assert(!(await helperFunction(imodel, [`TestSchema`], false)), `Schema ${testCase} test should not have succeeded.`);\r\n }\r\n\r\n // Importing a set of schemas should all fail if any one of them fails\r\n {\r\n const schemaXmls = [`<ECSchema schemaName=\"TestSchema1\" alias=\"ts1\" version=\"1.0.0\" xmlns=\"http://www.bentley.com/schemas/Bentley.ECXML.3.2\"/>`,\r\n `<ECSchema schemaName=\"TestSchema2\" alias=\"ts2\" version=\"1.0.0\" xmlns=\"http://www.bentley.com/schemas/Bentley.ECXML.3.8\"/>`,\r\n `<ECSchema schemaName=\"TestSchema3\" alias=\"ts3\" version=\"1.0.0\" xmlns=\"http://www.bentley.com/schemas/Bentley.ECXML.4.5\"/>`];\r\n\r\n assert(!(await helperFunction(imodel, schemaXmls, true)), `Schema import should not have succeeded.`);\r\n assert(!(await helperFunction(imodel, [`TestSchema1`], false)), `Schema TestSchema1 import should not have succeeded.`);\r\n assert(!(await helperFunction(imodel, [`TestSchema2`], false)), `Schema TestSchema2 import should not have succeeded.`);\r\n assert(!(await helperFunction(imodel, [`TestSchema3`], false)), `Schema TestSchema3 import should not have succeeded.`);\r\n }\r\n\r\n // Schema should be imported successfully\r\n for (const testCase of [`3.2`, `3.5`]) {\r\n assert(await helperFunction(imodel, [`<ECSchema schemaName=\"TestSchema\" alias=\"ts\" version=\"1.0.0\" xmlns=\"http://www.bentley.com/schemas/Bentley.ECXML.${testCase}\"/>`], true), `Schema ${testCase} import should have succeeded.`);\r\n assert(await helperFunction(imodel, [`TestSchema`], false), `Schema ${testCase} test should have succeeded.`);\r\n }\r\n });\r\n});\r\n"]}
1
+ {"version":3,"file":"SchemaXmlImport.test.js","sourceRoot":"","sources":["../../../../src/test/imodel/SchemaXmlImport.test.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAE/D,QAAQ,CAAC,yBAAyB,EAAE,GAAG,EAAE;IACvC,MAAM,CAAC,GAAG,EAAE;QACV,qBAAqB;QACrB,IAAI,KAAK,EAAE,CAAC;YACV,MAAM,CAAC,mBAAmB,EAAE,CAAC;YAC7B,MAAM,CAAC,eAAe,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QACzC,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0BAA0B,EAAE,KAAK,IAAI,EAAE;QACxC,MAAM,YAAY,GAAG,eAAe,CAAC,iBAAiB,CAAC,iBAAiB,EAAE,qBAAqB,CAAC,CAAC;QACjG,MAAM,MAAM,GAAG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AE,cAAc,EAAE,GAAG,CAAC,CAAC;YACjD,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC;YAExD,MAAM,OAAO,GAAG,MAAM,UAAU,CAAC,aAAa,CAAC,aAAa,CAAC,kCAAkC,EAAE,MAAM,CAAC,CAAC;YACzG,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;YAC1B,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;YACjD,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,cAAc,EAAE,GAAG,CAAC,CAAC;YACjD,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,eAAe,EAAE,YAAY,CAAC,CAAC;QAC7D,CAAC;gBAAS,CAAC;YACT,UAAU,CAAC,KAAK,EAAE,CAAC;QACrB,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","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\nimport { assert } from \"chai\";\r\nimport * as fs from \"fs\";\r\nimport * as path from \"path\";\r\nimport { PhysicalElement, SnapshotDb } from \"../../core-backend\";\r\nimport { IModelTestUtils } from \"../IModelTestUtils\";\r\nimport { Logger, LogLevel } from \"@itwin/core-bentley\";\r\nimport { KnownTestLocations } from \"../KnownTestLocations\";\r\nimport { EntityClass, Format } from \"@itwin/ecschema-metadata\";\r\n\r\ndescribe(\"Schema XML Import Tests\", () => {\r\n before(() => {\r\n // initialize logging\r\n if (false) {\r\n Logger.initializeToConsole();\r\n Logger.setLevelDefault(LogLevel.Error);\r\n }\r\n });\r\n\r\n it(\"should import schema XML\", async () => {\r\n const testFileName = IModelTestUtils.prepareOutputFile(\"SchemaXMLImport\", \"SchemaXMLImport.bim\");\r\n const imodel = SnapshotDb.createEmpty(testFileName, { rootSubject: { name: \"SchemaXMLImportTest\" } });\r\n\r\n try {\r\n const schemaFilePath = path.join(KnownTestLocations.assetsDir, \"Test3.ecschema.xml\");\r\n const schemaString = fs.readFileSync(schemaFilePath, \"utf8\");\r\n\r\n await imodel.importSchemaStrings([schemaString]); // will throw an exception if import fails\r\n\r\n const testDomainClass = await imodel.schemaContext.getSchemaItem(\"Test3.Test3Element\", EntityClass);\r\n assert.isDefined(testDomainClass);\r\n\r\n assert.isDefined(testDomainClass?.baseClass);\r\n\r\n assert.equal(testDomainClass?.baseClass?.fullName, PhysicalElement.classFullName.replace(\":\", \".\"));\r\n } finally {\r\n imodel.close();\r\n }\r\n });\r\n\r\n it(\"Schema import for newer ECXml Versions\", async () => {\r\n const testFileName = IModelTestUtils.prepareOutputFile(\"SchemaXMLImport\", \"SchemaVersionTest.bim\");\r\n const imodel = SnapshotDb.createEmpty(testFileName, { rootSubject: { name: \"SchemaVersionTest\" } });\r\n\r\n try {\r\n const helperFunction = async (imodelDb: SnapshotDb, xmlSchema: string[], importSchema: boolean) => {\r\n try {\r\n // ECObjects is expected to throw for schemas that fail to import\r\n if (importSchema)\r\n await imodelDb.importSchemaStrings(xmlSchema);\r\n else\r\n imodelDb.getSchemaProps(xmlSchema[0]);\r\n } catch {\r\n return false;\r\n }\r\n return true;\r\n };\r\n\r\n // Incrementing major ECXml version is not supported\r\n for (const testCase of [`4.1`, `5.10`]) {\r\n assert(!(await helperFunction(imodel, [`<ECSchema schemaName=\"TestSchema\" alias=\"ts\" version=\"1.0.0\" xmlns=\"http://www.bentley.com/schemas/Bentley.ECXML.${testCase}\"/>`], true)), `Schema ${testCase} import should not have succeeded.`);\r\n assert(!(await helperFunction(imodel, [`TestSchema`], false)), `Schema ${testCase} test should not have succeeded.`);\r\n }\r\n\r\n // Importing a set of schemas should all fail if any one of them fails\r\n {\r\n const schemaXmls = [`<ECSchema schemaName=\"TestSchema1\" alias=\"ts1\" version=\"1.0.0\" xmlns=\"http://www.bentley.com/schemas/Bentley.ECXML.3.2\"/>`,\r\n `<ECSchema schemaName=\"TestSchema2\" alias=\"ts2\" version=\"1.0.0\" xmlns=\"http://www.bentley.com/schemas/Bentley.ECXML.3.8\"/>`,\r\n `<ECSchema schemaName=\"TestSchema3\" alias=\"ts3\" version=\"1.0.0\" xmlns=\"http://www.bentley.com/schemas/Bentley.ECXML.4.5\"/>`];\r\n\r\n assert(!(await helperFunction(imodel, schemaXmls, true)), `Schema import should not have succeeded.`);\r\n assert(!(await helperFunction(imodel, [`TestSchema1`], false)), `Schema TestSchema1 import should not have succeeded.`);\r\n assert(!(await helperFunction(imodel, [`TestSchema2`], false)), `Schema TestSchema2 import should not have succeeded.`);\r\n assert(!(await helperFunction(imodel, [`TestSchema3`], false)), `Schema TestSchema3 import should not have succeeded.`);\r\n }\r\n\r\n // Schema should be imported successfully\r\n for (const testCase of [`3.2`, `3.5`]) {\r\n assert(await helperFunction(imodel, [`<ECSchema schemaName=\"TestSchema\" alias=\"ts\" version=\"1.0.0\" xmlns=\"http://www.bentley.com/schemas/Bentley.ECXML.${testCase}\"/>`], true), `Schema ${testCase} import should have succeeded.`);\r\n assert(await helperFunction(imodel, [`TestSchema`], false), `Schema ${testCase} test should have succeeded.`);\r\n }\r\n } finally {\r\n imodel.close();\r\n }\r\n });\r\n\r\n it.skip(\"should roundtrip ratio format properties\", async () => {\r\n // Create a separate iModel for this test\r\n const testFileName = IModelTestUtils.prepareOutputFile(\"SchemaXMLImport\", \"RatioFormatRoundtrip.bim\");\r\n const testIModel = SnapshotDb.createEmpty(testFileName, { rootSubject: { name: \"RatioFormatTest\" } });\r\n\r\n try {\r\n const schemaXml = `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n <ECSchema schemaName=\"RatioFormatTest\" alias=\"rft\" version=\"01.00.00\" xmlns=\"http://www.bentley.com/schemas/Bentley.ECXML.3.2\">\r\n <ECSchemaReference name=\"Units\" version=\"01.00.09\" alias=\"u\"/>\r\n <Format typeName=\"TestRatioFormat\" type=\"Ratio\" ratioType=\"OneToN\" ratioSeparator=\":\" ratioFormatType=\"Decimal\" precision=\"4\" formatTraits=\"trailZeroes|showUnitLabel\">\r\n <Composite>\r\n <Unit>u:M</Unit>\r\n </Composite>\r\n </Format>\r\n <Format typeName=\"TestRatioFormat2\" type=\"Ratio\" ratioType=\"NToOne\" ratioSeparator=\"=\" ratioFormatType=\"Fractional\" precision=\"8\" formatTraits=\"keepSingleZero\">\r\n <Composite>\r\n <Unit>u:M</Unit>\r\n </Composite>\r\n </Format>\r\n </ECSchema>`;\r\n\r\n // Import schema into iModel\r\n await testIModel.importSchemaStrings([schemaXml]);\r\n\r\n // Read back the format from the iModel's schema context\r\n const format1 = await testIModel.schemaContext.getSchemaItem(\"RatioFormatTest.TestRatioFormat\", Format);\r\n assert.isDefined(format1);\r\n assert.strictEqual(format1?.ratioType, \"OneToN\");\r\n assert.strictEqual(format1?.ratioSeparator, \":\");\r\n assert.strictEqual(format1?.ratioFormatType, \"Decimal\");\r\n\r\n const format2 = await testIModel.schemaContext.getSchemaItem(\"RatioFormatTest.TestRatioFormat2\", Format);\r\n assert.isDefined(format2);\r\n assert.strictEqual(format2?.ratioType, \"NToOne\");\r\n assert.strictEqual(format2?.ratioSeparator, \"=\");\r\n assert.strictEqual(format2?.ratioFormatType, \"Fractional\");\r\n } finally {\r\n testIModel.close();\r\n }\r\n });\r\n});\r\n"]}
@@ -85,7 +85,7 @@ describe("Schema Import Callbacks", () => {
85
85
  { id: "0x1", classFullName: "BisCore:DefinitionElement" },
86
86
  { id: "0x2", classFullName: "BisCore:DefinitionElement" },
87
87
  ],
88
- timestamp: Date.now(),
88
+ cachedNumber: 1234,
89
89
  };
90
90
  await imodel.importSchemaStrings([testSchemaV100()], {
91
91
  schemaImportCallbacks: {
@@ -96,7 +96,7 @@ describe("Schema Import Callbacks", () => {
96
96
  { id: "0x1", classFullName: "BisCore:DefinitionElement" },
97
97
  { id: "0x2", classFullName: "BisCore:DefinitionElement" },
98
98
  ],
99
- timestamp: Date.now(),
99
+ cachedNumber: 1234,
100
100
  },
101
101
  }),
102
102
  postSchemaImportCallback: async (context) => {
@@ -104,7 +104,7 @@ describe("Schema Import Callbacks", () => {
104
104
  assert.isDefined(context.resources.cachedData);
105
105
  assert.equal(context.resources.cachedData.elements.length, 2);
106
106
  assert.deepEqual(receivedCachedData.elements, expectedCachedData.elements);
107
- assert.equal(receivedCachedData.timestamp, expectedCachedData.timestamp);
107
+ assert.equal(receivedCachedData.cachedNumber, expectedCachedData.cachedNumber);
108
108
  assert.isUndefined(context.resources.snapshot);
109
109
  },
110
110
  },
@@ -544,7 +544,7 @@ describe("Schema Import Callbacks", () => {
544
544
  it("should pass user data to all callbacks", async () => {
545
545
  const userData = {
546
546
  processId: "test-process-123",
547
- timestamp: Date.now(),
547
+ cachedNumber: 1234,
548
548
  metadata: { version: "1.0.0" },
549
549
  };
550
550
  const receivedData = {};