@itwin/ecschema-rpcinterface-tests 3.7.2 → 3.7.3

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 (31) hide show
  1. package/lib/backend/BackendInit.d.ts +1 -1
  2. package/lib/backend/BackendInit.js +27 -27
  3. package/lib/backend/BackendInit.js.map +1 -1
  4. package/lib/common/Settings.d.ts +39 -39
  5. package/lib/common/Settings.js +106 -106
  6. package/lib/common/Settings.js.map +1 -1
  7. package/lib/common/SideChannels.d.ts +3 -3
  8. package/lib/common/SideChannels.js +19 -19
  9. package/lib/common/SideChannels.js.map +1 -1
  10. package/lib/dist/_d48c.bundled-tests.js.map +1 -1
  11. package/lib/dist/bundled-tests.js +91581 -91554
  12. package/lib/dist/bundled-tests.js.map +1 -1
  13. package/lib/dist/core_frontend_lib_esm_ApproximateTerrainHeightsProps_js.bundled-tests.js +9 -9
  14. package/lib/dist/core_frontend_lib_esm_ApproximateTerrainHeightsProps_js.bundled-tests.js.map +1 -1
  15. package/lib/dist/object-storage.bundled-tests.js +1 -1
  16. package/lib/dist/object-storage.bundled-tests.js.map +1 -1
  17. package/lib/dist/{vendors-common_temp_node_modules_pnpm_itwin_object-storage-azure_1_4_0_node_modules_itwin_obj-3576c6.bundled-tests.js → vendors-common_temp_node_modules_pnpm_itwin_object-storage-azure_1_6_0_node_modules_itwin_obj-0f69b1.bundled-tests.js} +24381 -24630
  18. package/lib/dist/vendors-common_temp_node_modules_pnpm_itwin_object-storage-azure_1_6_0_node_modules_itwin_obj-0f69b1.bundled-tests.js.map +1 -0
  19. package/lib/dist/vendors-common_temp_node_modules_pnpm_loaders_gl_draco_3_3_1_node_modules_loaders_gl_draco_di-d3af41.bundled-tests.js.map +1 -1
  20. package/lib/dist/vendors-common_temp_node_modules_pnpm_reflect-metadata_0_1_13_node_modules_reflect-metadata_R-610cb3.bundled-tests.js.map +1 -1
  21. package/lib/frontend/SchemaRpcInterface.test.d.ts +1 -1
  22. package/lib/frontend/SchemaRpcInterface.test.js +31 -31
  23. package/lib/frontend/SchemaRpcInterface.test.js.map +1 -1
  24. package/lib/frontend/setup/IModelSession.d.ts +13 -13
  25. package/lib/frontend/setup/IModelSession.js +78 -78
  26. package/lib/frontend/setup/IModelSession.js.map +1 -1
  27. package/lib/frontend/setup/TestContext.d.ts +15 -15
  28. package/lib/frontend/setup/TestContext.js +68 -68
  29. package/lib/frontend/setup/TestContext.js.map +1 -1
  30. package/package.json +20 -20
  31. package/lib/dist/vendors-common_temp_node_modules_pnpm_itwin_object-storage-azure_1_4_0_node_modules_itwin_obj-3576c6.bundled-tests.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"IModelSession.js","sourceRoot":"","sources":["../../../src/frontend/setup/IModelSession.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,+BAA8B;AAC9B,wDAA4D;AAC5D,gFAAiE;AACjE,4DAA4G;AAG5G,4EAAoE;AAEpE,MAAa,aAAa;IAQxB,YAAmB,QAAgB,EAAE,OAAe,EAAE,WAAoB;QACxE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;IAEM,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,WAAwB,EAAE,UAAsB;;QACzE,IAAI,OAAO,CAAC;QACZ,IAAI,QAAQ,CAAC;QAEb,iCAAiC;QACjC,IAAI,UAAU,CAAC,YAAY,IAAI,UAAU,CAAC,SAAS,EAAE;YACnD,MAAM,MAAM,GAAG,IAAI,sCAAoB,EAAE,CAAC;YAC1C,MAAM,SAAS,GAAY,MAAM,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE;gBAC1D,MAAM,EAAE;oBACN,YAAY,EAAE,UAAU,CAAC,SAAS;oBAClC,YAAY,EAAE,4CAA0B,CAAC,IAAI;oBAC7C,UAAU,EAAE,IAAI;iBACj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AO,IAAI,aAAa,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;IACtE,CAAC;IAEM,KAAK,CAAC,aAAa;QACxB,OAAO,SAAS,KAAK,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC;IACjE,CAAC;IAEM,KAAK,CAAC,IAAI;QACf,IAAI;YACF,sCAAsC;YACtC,OAAO,CAAC,GAAG,CAAC,gBAAgB,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,CAAC,CAAC;YAC3D,IAAI,CAAC,OAAO,GAAG,MAAM,oCAAoB,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;YAClF,IAAA,aAAM,EAAC,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC;SAC/B;QAAC,OAAO,CAAM,EAAE;YACf,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;SACpE;QAED,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;CACF;AA7ED,sCA6EC","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 { expect } from \"chai\";\r\nimport { CheckpointConnection } from \"@itwin/core-frontend\";\r\nimport { IModelsClient } from \"@itwin/imodels-client-management\";\r\nimport { Project as ITwin, ProjectsAccessClient, ProjectsSearchableProperty } from \"@itwin/projects-client\";\r\nimport { IModelData } from \"../../common/Settings\";\r\nimport { AccessToken } from \"@itwin/core-bentley\";\r\nimport { AccessTokenAdapter } from \"@itwin/imodels-access-frontend\";\r\n\r\nexport class IModelSession {\r\n\r\n public iTwinId: string;\r\n public iModelId: string;\r\n public changesetId?: string;\r\n\r\n private _iModel?: CheckpointConnection;\r\n\r\n public constructor(iModelId: string, iTwinId: string, changesetId?: string) {\r\n this.iTwinId = iTwinId;\r\n this.iModelId = iModelId;\r\n this.changesetId = changesetId;\r\n }\r\n\r\n public static async create(accessToken: AccessToken, iModelData: IModelData): Promise<IModelSession> {\r\n let iTwinId;\r\n let imodelId;\r\n\r\n // Turn the iTwin name into an id\r\n if (iModelData.useITwinName && iModelData.iTwinName) {\r\n const client = new ProjectsAccessClient();\r\n const iTwinList: ITwin[] = await client.getAll(accessToken, {\r\n search: {\r\n searchString: iModelData.iTwinName,\r\n propertyName: ProjectsSearchableProperty.Name,\r\n exactMatch: true,\r\n },\r\n });\r\n\r\n if (iTwinList.length === 0)\r\n throw new Error(`ITwin ${iModelData.iTwinName} was not found for the user.`);\r\n else if (iTwinList.length > 1)\r\n throw new Error(`Multiple iTwins named ${iModelData.iTwinName} were found for the user.`);\r\n\r\n iTwinId = iTwinList[0].id;\r\n } else\r\n iTwinId = iModelData.iTwinId!;\r\n\r\n if (iModelData.useName) {\r\n const imodelClient = new IModelsClient({ api: { baseUrl: `https://${process.env.IMJS_URL_PREFIX ?? \"\"}api.bentley.com/imodels`}});\r\n const iModels = imodelClient.iModels.getRepresentationList({\r\n authorization: AccessTokenAdapter.toAuthorizationCallback(accessToken),\r\n urlParams: {\r\n projectId: iTwinId,\r\n name: iModelData.name,\r\n },\r\n });\r\n for await (const iModel of iModels) {\r\n imodelId = iModel.id;\r\n break;\r\n }\r\n if (!imodelId)\r\n throw new Error(`The iModel ${iModelData.name} does not exist in iTwin ${iTwinId}.`);\r\n } else\r\n imodelId = iModelData.id!;\r\n\r\n console.log(`Using iModel { name:${iModelData.name}, id:${imodelId}, iTwinId:${iTwinId}, changesetId:${iModelData.changesetId} }`); // eslint-disable-line no-console\r\n\r\n return new IModelSession(imodelId, iTwinId, iModelData.changesetId);\r\n }\r\n\r\n public async getConnection(): Promise<CheckpointConnection> {\r\n return undefined === this._iModel ? this.open() : this._iModel;\r\n }\r\n\r\n public async open(): Promise<CheckpointConnection> {\r\n try {\r\n // eslint-disable-next-line no-console\r\n console.log(`Environment: ${process.env.IMJS_URL_PREFIX}`);\r\n this._iModel = await CheckpointConnection.openRemote(this.iTwinId, this.iModelId);\r\n expect(this._iModel).to.exist;\r\n } catch (e: any) {\r\n throw new Error(`Failed to open test iModel. Error: ${e.message}`);\r\n }\r\n\r\n return this._iModel;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"IModelSession.js","sourceRoot":"","sources":["../../../src/frontend/setup/IModelSession.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,+BAA8B;AAC9B,wDAA4D;AAC5D,gFAAiE;AACjE,4DAA4G;AAG5G,4EAAoE;AAEpE,MAAa,aAAa;IAQxB,YAAmB,QAAgB,EAAE,OAAe,EAAE,WAAoB;QACxE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;IAEM,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,WAAwB,EAAE,UAAsB;;QACzE,IAAI,OAAO,CAAC;QACZ,IAAI,QAAQ,CAAC;QAEb,iCAAiC;QACjC,IAAI,UAAU,CAAC,YAAY,IAAI,UAAU,CAAC,SAAS,EAAE;YACnD,MAAM,MAAM,GAAG,IAAI,sCAAoB,EAAE,CAAC;YAC1C,MAAM,SAAS,GAAY,MAAM,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE;gBAC1D,MAAM,EAAE;oBACN,YAAY,EAAE,UAAU,CAAC,SAAS;oBAClC,YAAY,EAAE,4CAA0B,CAAC,IAAI;oBAC7C,UAAU,EAAE,IAAI;iBACjB;aACF,CAAC,CAAC;YAEH,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC;gBACxB,MAAM,IAAI,KAAK,CAAC,SAAS,UAAU,CAAC,SAAS,8BAA8B,CAA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,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC;IACjE,CAAC;IAEM,KAAK,CAAC,IAAI;QACf,IAAI;YACF,sCAAsC;YACtC,OAAO,CAAC,GAAG,CAAC,gBAAgB,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,CAAC,CAAC;YAC3D,IAAI,CAAC,OAAO,GAAG,MAAM,oCAAoB,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;YAClF,IAAA,aAAM,EAAC,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC;SAC/B;QAAC,OAAO,CAAM,EAAE;YACf,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;SACpE;QAED,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;CACF;AA7ED,sCA6EC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport { expect } from \"chai\";\nimport { CheckpointConnection } from \"@itwin/core-frontend\";\nimport { IModelsClient } from \"@itwin/imodels-client-management\";\nimport { Project as ITwin, ProjectsAccessClient, ProjectsSearchableProperty } from \"@itwin/projects-client\";\nimport { IModelData } from \"../../common/Settings\";\nimport { AccessToken } from \"@itwin/core-bentley\";\nimport { AccessTokenAdapter } from \"@itwin/imodels-access-frontend\";\n\nexport class IModelSession {\n\n public iTwinId: string;\n public iModelId: string;\n public changesetId?: string;\n\n private _iModel?: CheckpointConnection;\n\n public constructor(iModelId: string, iTwinId: string, changesetId?: string) {\n this.iTwinId = iTwinId;\n this.iModelId = iModelId;\n this.changesetId = changesetId;\n }\n\n public static async create(accessToken: AccessToken, iModelData: IModelData): Promise<IModelSession> {\n let iTwinId;\n let imodelId;\n\n // Turn the iTwin name into an id\n if (iModelData.useITwinName && iModelData.iTwinName) {\n const client = new ProjectsAccessClient();\n const iTwinList: ITwin[] = await client.getAll(accessToken, {\n search: {\n searchString: iModelData.iTwinName,\n propertyName: ProjectsSearchableProperty.Name,\n exactMatch: true,\n },\n });\n\n if (iTwinList.length === 0)\n throw new Error(`ITwin ${iModelData.iTwinName} was not found for the user.`);\n else if (iTwinList.length > 1)\n throw new Error(`Multiple iTwins named ${iModelData.iTwinName} were found for the user.`);\n\n iTwinId = iTwinList[0].id;\n } else\n iTwinId = iModelData.iTwinId!;\n\n if (iModelData.useName) {\n const imodelClient = new IModelsClient({ api: { baseUrl: `https://${process.env.IMJS_URL_PREFIX ?? \"\"}api.bentley.com/imodels`}});\n const iModels = imodelClient.iModels.getRepresentationList({\n authorization: AccessTokenAdapter.toAuthorizationCallback(accessToken),\n urlParams: {\n iTwinId,\n name: iModelData.name,\n },\n });\n for await (const iModel of iModels) {\n imodelId = iModel.id;\n break;\n }\n if (!imodelId)\n throw new Error(`The iModel ${iModelData.name} does not exist in iTwin ${iTwinId}.`);\n } else\n imodelId = iModelData.id!;\n\n console.log(`Using iModel { name:${iModelData.name}, id:${imodelId}, iTwinId:${iTwinId}, changesetId:${iModelData.changesetId} }`); // eslint-disable-line no-console\n\n return new IModelSession(imodelId, iTwinId, iModelData.changesetId);\n }\n\n public async getConnection(): Promise<CheckpointConnection> {\n return undefined === this._iModel ? this.open() : this._iModel;\n }\n\n public async open(): Promise<CheckpointConnection> {\n try {\n // eslint-disable-next-line no-console\n console.log(`Environment: ${process.env.IMJS_URL_PREFIX}`);\n this._iModel = await CheckpointConnection.openRemote(this.iTwinId, this.iModelId);\n expect(this._iModel).to.exist;\n } catch (e: any) {\n throw new Error(`Failed to open test iModel. Error: ${e.message}`);\n }\n\n return this._iModel;\n }\n}\n"]}
@@ -1,16 +1,16 @@
1
- import { AccessToken } from "@itwin/core-bentley";
2
- import { Settings } from "../../common/Settings";
3
- import { IModelSession } from "./IModelSession";
4
- export declare class TestContext {
5
- adminUserAccessToken: AccessToken;
6
- iModelWithChangesets?: IModelSession;
7
- iTwinId?: string;
8
- settings: Settings;
9
- private constructor();
10
- private static _instance?;
11
- static instance(): Promise<TestContext>;
12
- /** Initialize configuration for the rpc interfaces used by the application. */
13
- private initializeRpcInterfaces;
14
- private initialize;
15
- }
1
+ import { AccessToken } from "@itwin/core-bentley";
2
+ import { Settings } from "../../common/Settings";
3
+ import { IModelSession } from "./IModelSession";
4
+ export declare class TestContext {
5
+ adminUserAccessToken: AccessToken;
6
+ iModelWithChangesets?: IModelSession;
7
+ iTwinId?: string;
8
+ settings: Settings;
9
+ private constructor();
10
+ private static _instance?;
11
+ static instance(): Promise<TestContext>;
12
+ /** Initialize configuration for the rpc interfaces used by the application. */
13
+ private initializeRpcInterfaces;
14
+ private initialize;
15
+ }
16
16
  //# sourceMappingURL=TestContext.d.ts.map
@@ -1,69 +1,69 @@
1
- "use strict";
2
- /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
- * See LICENSE.md in the project root for license terms and full copyright notice.
5
- *--------------------------------------------------------------------------------------------*/
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.TestContext = void 0;
8
- const chai_1 = require("chai");
9
- const core_bentley_1 = require("@itwin/core-bentley");
10
- const core_frontend_1 = require("@itwin/core-frontend");
11
- const frontend_1 = require("@itwin/oidc-signin-tool/lib/cjs/frontend");
12
- const Settings_1 = require("../../common/Settings");
13
- const SideChannels_1 = require("../../common/SideChannels");
14
- const IModelSession_1 = require("./IModelSession");
15
- const core_common_1 = require("@itwin/core-common");
16
- const imodels_access_frontend_1 = require("@itwin/imodels-access-frontend");
17
- const imodels_client_management_1 = require("@itwin/imodels-client-management");
18
- class TestContext {
19
- constructor(env) {
20
- this.settings = new Settings_1.Settings(env);
21
- }
22
- static async instance() {
23
- if (this._instance === undefined) {
24
- this._instance = new TestContext(await (0, SideChannels_1.getProcessEnvFromBackend)());
25
- await this._instance.initialize();
26
- }
27
- return this._instance;
28
- }
29
- /** Initialize configuration for the rpc interfaces used by the application. */
30
- initializeRpcInterfaces(info) {
31
- // Url without trailing slash
32
- const uriPrefix = this.settings.Backend.location.replace(/\/$/, "");
33
- core_common_1.BentleyCloudRpcManager.initializeClient({ info, uriPrefix }, (0, Settings_1.getRpcInterfaces)());
34
- }
35
- async initialize() {
36
- var _a;
37
- (0, chai_1.expect)(this.settings.users.length).to.be.gte(1, `Unexpected number of users found in settings - got ${this.settings.users.length}, expected at least 2`);
38
- // Print out the configuration
39
- console.log(this.settings.toString()); // eslint-disable-line
40
- // Configure iTwin.js frontend logging to go to the console
41
- core_bentley_1.Logger.initializeToConsole();
42
- core_bentley_1.Logger.setLevelDefault(this.settings.logLevel === undefined ? core_bentley_1.LogLevel.Warning : this.settings.logLevel);
43
- if (undefined !== this.settings.oidcClientId) {
44
- this.adminUserAccessToken = await (0, frontend_1.getAccessTokenFromBackend)({
45
- email: this.settings.users[0].email,
46
- password: this.settings.users[0].password,
47
- }, {
48
- clientId: this.settings.oidcClientId,
49
- redirectUri: this.settings.oidcRedirect,
50
- scope: this.settings.oidcScopes,
51
- authority: this.settings.oidcAuthority,
52
- });
53
- }
54
- const iModelData = this.settings.iModel;
55
- this.iModelWithChangesets = await IModelSession_1.IModelSession.create(this.adminUserAccessToken, iModelData);
56
- this.iTwinId = this.iModelWithChangesets.iTwinId;
57
- this.initializeRpcInterfaces({ title: this.settings.Backend.name, version: this.settings.Backend.version });
58
- const iModelClient = new imodels_client_management_1.IModelsClient({ api: { baseUrl: `https://${(_a = process.env.IMJS_URL_PREFIX) !== null && _a !== void 0 ? _a : ""}api.bentley.com/imodels` } });
59
- await core_frontend_1.NoRenderApp.startup({
60
- applicationId: this.settings.gprid,
61
- authorizationClient: new frontend_1.TestFrontendAuthorizationClient(this.adminUserAccessToken),
62
- hubAccess: new imodels_access_frontend_1.FrontendIModelsAccess(iModelClient),
63
- });
64
- console.log("TestSetup: Done"); // eslint-disable-line
65
- }
66
- }
67
- exports.TestContext = TestContext;
68
- TestContext._instance = undefined;
1
+ "use strict";
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
+ * See LICENSE.md in the project root for license terms and full copyright notice.
5
+ *--------------------------------------------------------------------------------------------*/
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.TestContext = void 0;
8
+ const chai_1 = require("chai");
9
+ const core_bentley_1 = require("@itwin/core-bentley");
10
+ const core_frontend_1 = require("@itwin/core-frontend");
11
+ const frontend_1 = require("@itwin/oidc-signin-tool/lib/cjs/frontend");
12
+ const Settings_1 = require("../../common/Settings");
13
+ const SideChannels_1 = require("../../common/SideChannels");
14
+ const IModelSession_1 = require("./IModelSession");
15
+ const core_common_1 = require("@itwin/core-common");
16
+ const imodels_access_frontend_1 = require("@itwin/imodels-access-frontend");
17
+ const imodels_client_management_1 = require("@itwin/imodels-client-management");
18
+ class TestContext {
19
+ constructor(env) {
20
+ this.settings = new Settings_1.Settings(env);
21
+ }
22
+ static async instance() {
23
+ if (this._instance === undefined) {
24
+ this._instance = new TestContext(await (0, SideChannels_1.getProcessEnvFromBackend)());
25
+ await this._instance.initialize();
26
+ }
27
+ return this._instance;
28
+ }
29
+ /** Initialize configuration for the rpc interfaces used by the application. */
30
+ initializeRpcInterfaces(info) {
31
+ // Url without trailing slash
32
+ const uriPrefix = this.settings.Backend.location.replace(/\/$/, "");
33
+ core_common_1.BentleyCloudRpcManager.initializeClient({ info, uriPrefix }, (0, Settings_1.getRpcInterfaces)());
34
+ }
35
+ async initialize() {
36
+ var _a;
37
+ (0, chai_1.expect)(this.settings.users.length).to.be.gte(1, `Unexpected number of users found in settings - got ${this.settings.users.length}, expected at least 2`);
38
+ // Print out the configuration
39
+ console.log(this.settings.toString()); // eslint-disable-line
40
+ // Configure iTwin.js frontend logging to go to the console
41
+ core_bentley_1.Logger.initializeToConsole();
42
+ core_bentley_1.Logger.setLevelDefault(this.settings.logLevel === undefined ? core_bentley_1.LogLevel.Warning : this.settings.logLevel);
43
+ if (undefined !== this.settings.oidcClientId) {
44
+ this.adminUserAccessToken = await (0, frontend_1.getAccessTokenFromBackend)({
45
+ email: this.settings.users[0].email,
46
+ password: this.settings.users[0].password,
47
+ }, {
48
+ clientId: this.settings.oidcClientId,
49
+ redirectUri: this.settings.oidcRedirect,
50
+ scope: this.settings.oidcScopes,
51
+ authority: this.settings.oidcAuthority,
52
+ });
53
+ }
54
+ const iModelData = this.settings.iModel;
55
+ this.iModelWithChangesets = await IModelSession_1.IModelSession.create(this.adminUserAccessToken, iModelData);
56
+ this.iTwinId = this.iModelWithChangesets.iTwinId;
57
+ this.initializeRpcInterfaces({ title: this.settings.Backend.name, version: this.settings.Backend.version });
58
+ const iModelClient = new imodels_client_management_1.IModelsClient({ api: { baseUrl: `https://${(_a = process.env.IMJS_URL_PREFIX) !== null && _a !== void 0 ? _a : ""}api.bentley.com/imodels` } });
59
+ await core_frontend_1.NoRenderApp.startup({
60
+ applicationId: this.settings.gprid,
61
+ authorizationClient: new frontend_1.TestFrontendAuthorizationClient(this.adminUserAccessToken),
62
+ hubAccess: new imodels_access_frontend_1.FrontendIModelsAccess(iModelClient),
63
+ });
64
+ console.log("TestSetup: Done"); // eslint-disable-line
65
+ }
66
+ }
67
+ exports.TestContext = TestContext;
68
+ TestContext._instance = undefined;
69
69
  //# sourceMappingURL=TestContext.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TestContext.js","sourceRoot":"","sources":["../../../src/frontend/setup/TestContext.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,+BAA8B;AAC9B,sDAAoE;AACpE,wDAAmD;AACnD,uEAEkD;AAClD,oDAAmE;AACnE,4DAAqE;AACrE,mDAAgD;AAChD,oDAAyE;AACzE,4EAAuE;AACvE,gFAAiE;AAEjE,MAAa,WAAW;IAQtB,YAAoB,GAAsB;QACxC,IAAI,CAAC,QAAQ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C;YACnF,SAAS,EAAE,IAAI,+CAAqB,CAAC,YAAY,CAAC;SACnD,CAAC,CAAC;QAEH,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAE,sBAAsB;IACzD,CAAC;;AAlEH,kCAmEC;AAxDgB,qBAAS,GAAiB,SAAS,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\n\r\nimport { expect } from \"chai\";\r\nimport { AccessToken, Logger, LogLevel } from \"@itwin/core-bentley\";\r\nimport { NoRenderApp } from \"@itwin/core-frontend\";\r\nimport {\r\n getAccessTokenFromBackend, TestBrowserAuthorizationClientConfiguration, TestFrontendAuthorizationClient, TestUserCredentials,\r\n} from \"@itwin/oidc-signin-tool/lib/cjs/frontend\";\r\nimport { getRpcInterfaces, Settings } from \"../../common/Settings\";\r\nimport { getProcessEnvFromBackend } from \"../../common/SideChannels\";\r\nimport { IModelSession } from \"./IModelSession\";\r\nimport { BentleyCloudRpcManager, OpenAPIInfo } from \"@itwin/core-common\";\r\nimport { FrontendIModelsAccess } from \"@itwin/imodels-access-frontend\";\r\nimport { IModelsClient } from \"@itwin/imodels-client-management\";\r\n\r\nexport class TestContext {\r\n public adminUserAccessToken!: AccessToken;\r\n\r\n public iModelWithChangesets?: IModelSession;\r\n public iTwinId?: string;\r\n\r\n public settings: Settings;\r\n\r\n private constructor(env: NodeJS.ProcessEnv) {\r\n this.settings = new Settings(env);\r\n }\r\n private static _instance?: TestContext = undefined;\r\n\r\n public static async instance(): Promise<TestContext> {\r\n if (this._instance === undefined) {\r\n this._instance = new TestContext(await getProcessEnvFromBackend());\r\n await this._instance.initialize();\r\n }\r\n return this._instance;\r\n }\r\n\r\n /** Initialize configuration for the rpc interfaces used by the application. */\r\n private initializeRpcInterfaces(info: OpenAPIInfo) { // eslint-disable-line deprecation/deprecation\r\n // Url without trailing slash\r\n const uriPrefix: string = this.settings.Backend.location.replace(/\\/$/, \"\");\r\n BentleyCloudRpcManager.initializeClient({ info, uriPrefix }, getRpcInterfaces());\r\n }\r\n\r\n private async initialize() {\r\n expect(this.settings.users.length).to.be.gte(1, `Unexpected number of users found in settings - got ${this.settings.users.length}, expected at least 2`);\r\n\r\n // Print out the configuration\r\n console.log(this.settings.toString()); // eslint-disable-line\r\n\r\n // Configure iTwin.js frontend logging to go to the console\r\n Logger.initializeToConsole();\r\n Logger.setLevelDefault(this.settings.logLevel === undefined ? LogLevel.Warning : this.settings.logLevel);\r\n\r\n if (undefined !== this.settings.oidcClientId) {\r\n this.adminUserAccessToken = await getAccessTokenFromBackend({\r\n email: this.settings.users[0].email,\r\n password: this.settings.users[0].password,\r\n } as TestUserCredentials, {\r\n clientId: this.settings.oidcClientId,\r\n redirectUri: this.settings.oidcRedirect,\r\n scope: this.settings.oidcScopes,\r\n authority: this.settings.oidcAuthority,\r\n } as TestBrowserAuthorizationClientConfiguration);\r\n }\r\n\r\n const iModelData = this.settings.iModel;\r\n\r\n this.iModelWithChangesets = await IModelSession.create(this.adminUserAccessToken, iModelData);\r\n this.iTwinId = this.iModelWithChangesets.iTwinId;\r\n\r\n this.initializeRpcInterfaces({ title: this.settings.Backend.name, version: this.settings.Backend.version });\r\n\r\n const iModelClient = new IModelsClient({ api: { baseUrl: `https://${process.env.IMJS_URL_PREFIX ?? \"\"}api.bentley.com/imodels` } });\r\n\r\n await NoRenderApp.startup({\r\n applicationId: this.settings.gprid,\r\n authorizationClient: new TestFrontendAuthorizationClient(this.adminUserAccessToken),\r\n hubAccess: new FrontendIModelsAccess(iModelClient),\r\n });\r\n\r\n console.log(\"TestSetup: Done\"); // eslint-disable-line\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"TestContext.js","sourceRoot":"","sources":["../../../src/frontend/setup/TestContext.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,+BAA8B;AAC9B,sDAAo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AAyB,EAAE,EAAE,CAAC,CAAC;QAEpI,MAAM,2BAAW,CAAC,OAAO,CAAC;YACxB,aAAa,EAAE,IAAI,CAAC,QAAQ,CAAC,KAAK;YAClC,mBAAmB,EAAE,IAAI,0CAA+B,CAAC,IAAI,CAAC,oBAAoB,CAAC;YACnF,SAAS,EAAE,IAAI,+CAAqB,CAAC,YAAY,CAAC;SACnD,CAAC,CAAC;QAEH,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAE,sBAAsB;IACzD,CAAC;;AAlEH,kCAmEC;AAxDgB,qBAAS,GAAiB,SAAS,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nimport { expect } from \"chai\";\nimport { AccessToken, Logger, LogLevel } from \"@itwin/core-bentley\";\nimport { NoRenderApp } from \"@itwin/core-frontend\";\nimport {\n getAccessTokenFromBackend, TestBrowserAuthorizationClientConfiguration, TestFrontendAuthorizationClient, TestUserCredentials,\n} from \"@itwin/oidc-signin-tool/lib/cjs/frontend\";\nimport { getRpcInterfaces, Settings } from \"../../common/Settings\";\nimport { getProcessEnvFromBackend } from \"../../common/SideChannels\";\nimport { IModelSession } from \"./IModelSession\";\nimport { BentleyCloudRpcManager, OpenAPIInfo } from \"@itwin/core-common\";\nimport { FrontendIModelsAccess } from \"@itwin/imodels-access-frontend\";\nimport { IModelsClient } from \"@itwin/imodels-client-management\";\n\nexport class TestContext {\n public adminUserAccessToken!: AccessToken;\n\n public iModelWithChangesets?: IModelSession;\n public iTwinId?: string;\n\n public settings: Settings;\n\n private constructor(env: NodeJS.ProcessEnv) {\n this.settings = new Settings(env);\n }\n private static _instance?: TestContext = undefined;\n\n public static async instance(): Promise<TestContext> {\n if (this._instance === undefined) {\n this._instance = new TestContext(await getProcessEnvFromBackend());\n await this._instance.initialize();\n }\n return this._instance;\n }\n\n /** Initialize configuration for the rpc interfaces used by the application. */\n private initializeRpcInterfaces(info: OpenAPIInfo) { // eslint-disable-line deprecation/deprecation\n // Url without trailing slash\n const uriPrefix: string = this.settings.Backend.location.replace(/\\/$/, \"\");\n BentleyCloudRpcManager.initializeClient({ info, uriPrefix }, getRpcInterfaces());\n }\n\n private async initialize() {\n expect(this.settings.users.length).to.be.gte(1, `Unexpected number of users found in settings - got ${this.settings.users.length}, expected at least 2`);\n\n // Print out the configuration\n console.log(this.settings.toString()); // eslint-disable-line\n\n // Configure iTwin.js frontend logging to go to the console\n Logger.initializeToConsole();\n Logger.setLevelDefault(this.settings.logLevel === undefined ? LogLevel.Warning : this.settings.logLevel);\n\n if (undefined !== this.settings.oidcClientId) {\n this.adminUserAccessToken = await getAccessTokenFromBackend({\n email: this.settings.users[0].email,\n password: this.settings.users[0].password,\n } as TestUserCredentials, {\n clientId: this.settings.oidcClientId,\n redirectUri: this.settings.oidcRedirect,\n scope: this.settings.oidcScopes,\n authority: this.settings.oidcAuthority,\n } as TestBrowserAuthorizationClientConfiguration);\n }\n\n const iModelData = this.settings.iModel;\n\n this.iModelWithChangesets = await IModelSession.create(this.adminUserAccessToken, iModelData);\n this.iTwinId = this.iModelWithChangesets.iTwinId;\n\n this.initializeRpcInterfaces({ title: this.settings.Backend.name, version: this.settings.Backend.version });\n\n const iModelClient = new IModelsClient({ api: { baseUrl: `https://${process.env.IMJS_URL_PREFIX ?? \"\"}api.bentley.com/imodels` } });\n\n await NoRenderApp.startup({\n applicationId: this.settings.gprid,\n authorizationClient: new TestFrontendAuthorizationClient(this.adminUserAccessToken),\n hubAccess: new FrontendIModelsAccess(iModelClient),\n });\n\n console.log(\"TestSetup: Done\"); // eslint-disable-line\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/ecschema-rpcinterface-tests",
3
- "version": "3.7.2",
3
+ "version": "3.7.3",
4
4
  "description": "Integration tests for the Schema RPC Interface",
5
5
  "author": {
6
6
  "name": "Bentley Systems, Inc.",
@@ -11,23 +11,23 @@
11
11
  "url": "https://github.com/iTwin/itwinjs-core/tree/master/full-stack-tests/ecschema-rpc-interface"
12
12
  },
13
13
  "dependencies": {
14
- "@itwin/build-tools": "3.7.2",
15
- "@itwin/certa": "3.7.2",
16
- "@itwin/core-bentley": "3.7.2",
17
- "@itwin/core-common": "3.7.2",
18
- "@itwin/core-frontend": "3.7.2",
19
- "@itwin/core-geometry": "3.7.2",
20
- "@itwin/core-quantity": "3.7.2",
21
- "@itwin/ecschema-metadata": "3.7.2",
22
- "@itwin/ecschema-rpcinterface-common": "3.7.2",
23
- "@itwin/ecschema-rpcinterface-impl": "3.7.2",
24
- "@itwin/imodels-access-backend": "^2.2.1",
25
- "@itwin/imodels-access-frontend": "^2.2.1",
26
- "@itwin/imodels-client-authoring": "^2.2.1",
27
- "@itwin/imodels-client-management": "^2.2.1",
14
+ "@itwin/build-tools": "3.7.3",
15
+ "@itwin/certa": "3.7.3",
16
+ "@itwin/core-bentley": "3.7.3",
17
+ "@itwin/core-common": "3.7.3",
18
+ "@itwin/core-frontend": "3.7.3",
19
+ "@itwin/core-geometry": "3.7.3",
20
+ "@itwin/core-quantity": "3.7.3",
21
+ "@itwin/ecschema-metadata": "3.7.3",
22
+ "@itwin/ecschema-rpcinterface-common": "3.7.3",
23
+ "@itwin/ecschema-rpcinterface-impl": "3.7.3",
24
+ "@itwin/imodels-access-backend": "^3.0.0",
25
+ "@itwin/imodels-access-frontend": "^3.0.0",
26
+ "@itwin/imodels-client-authoring": "^3.0.0",
27
+ "@itwin/imodels-client-management": "^3.0.0",
28
28
  "@itwin/oidc-signin-tool": "~3.6.0",
29
- "@itwin/presentation-common": "3.7.2",
30
- "@itwin/presentation-frontend": "3.7.2",
29
+ "@itwin/presentation-common": "3.7.3",
30
+ "@itwin/presentation-frontend": "3.7.3",
31
31
  "chai": "^4.1.2",
32
32
  "chai-as-promised": "^7",
33
33
  "dotenv": "^10.0.0",
@@ -37,9 +37,9 @@
37
37
  "puppeteer": "15.5.0"
38
38
  },
39
39
  "devDependencies": {
40
- "@itwin/core-backend": "3.7.2",
41
- "@itwin/eslint-plugin": "3.7.2",
42
- "@itwin/express-server": "3.7.2",
40
+ "@itwin/core-backend": "3.7.3",
41
+ "@itwin/eslint-plugin": "3.7.3",
42
+ "@itwin/express-server": "3.7.3",
43
43
  "@itwin/projects-client": "^0.6.0",
44
44
  "@types/chai": "4.3.1",
45
45
  "@types/chai-as-promised": "^7",