@itwin/ecschema-rpcinterface-tests 3.0.0-dev.146 → 3.0.0-dev.151

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.
@@ -45,8 +45,8 @@ class IModelSession {
45
45
  }
46
46
  else
47
47
  imodelId = iModelData.id;
48
- console.log(`Using iModel { name:${iModelData.name}, id:${iModelData.id}, projectId:${iModelData.iTwinId}, changesetId:${iModelData.changesetId} }`); // eslint-disable-line no-console
49
- return new IModelSession(contextId, imodelId, iModelData.changesetId);
48
+ console.log(`Using iModel { name:${iModelData.name}, id:${imodelId}, iTwinId:${contextId}, changesetId:${iModelData.changesetId} }`); // eslint-disable-line no-console
49
+ return new IModelSession(imodelId, contextId, iModelData.changesetId);
50
50
  }
51
51
  async getConnection() {
52
52
  return undefined === this._iModel ? this.open() : this._iModel;
@@ -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,gEAAyE;AACzE,4DAA4G;AAI5G,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,cAA2B,EAAE,UAAsB;QAC5E,IAAI,SAAS,CAAC;QACd,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,cAAc,EAAE;gBAC7D,M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UAAU,CAAC,WAAW,CAAC,CAAC;IACxE,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;AApED,sCAoEC","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 { IModelHubClient, IModelQuery } from \"@bentley/imodelhub-client\";\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\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(requestContext: AccessToken, iModelData: IModelData): Promise<IModelSession> {\r\n let contextId;\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(requestContext, {\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 contextId = iTwinList[0].id;\r\n } else\r\n contextId = iModelData.iTwinId!;\r\n\r\n if (iModelData.useName) {\r\n const imodelClient = new IModelHubClient();\r\n const imodels = await imodelClient.iModels.get(requestContext, contextId, new IModelQuery().byName(iModelData.name!));\r\n if (undefined === imodels || imodels.length === 0)\r\n throw new Error(`The iModel ${iModelData.name} does not exist in project ${contextId}.`);\r\n imodelId = imodels[0].wsgId;\r\n } else\r\n imodelId = iModelData.id!;\r\n\r\n console.log(`Using iModel { name:${iModelData.name}, id:${iModelData.id}, projectId:${iModelData.iTwinId}, changesetId:${iModelData.changesetId} }`); // eslint-disable-line no-console\r\n\r\n return new IModelSession(contextId, imodelId, 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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K,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;AApED,sCAoEC","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 { IModelHubClient, IModelQuery } from \"@bentley/imodelhub-client\";\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\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(requestContext: AccessToken, iModelData: IModelData): Promise<IModelSession> {\r\n let contextId;\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(requestContext, {\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 contextId = iTwinList[0].id;\r\n } else\r\n contextId = iModelData.iTwinId!;\r\n\r\n if (iModelData.useName) {\r\n const imodelClient = new IModelHubClient();\r\n const imodels = await imodelClient.iModels.get(requestContext, contextId, new IModelQuery().byName(iModelData.name!));\r\n if (undefined === imodels || imodels.length === 0)\r\n throw new Error(`The iModel ${iModelData.name} does not exist in project ${contextId}.`);\r\n imodelId = imodels[0].wsgId;\r\n } else\r\n imodelId = iModelData.id!;\r\n\r\n console.log(`Using iModel { name:${iModelData.name}, id:${imodelId}, iTwinId:${contextId}, changesetId:${iModelData.changesetId} }`); // eslint-disable-line no-console\r\n\r\n return new IModelSession(imodelId, contextId, 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 +1 @@
1
- {"version":3,"file":"TestContext.d.ts","sourceRoot":"","sources":["../../../src/frontend/setup/TestContext.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAoB,MAAM,qBAAqB,CAAC;AAKpE,OAAO,EAAoB,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEnE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD,qBAAa,WAAW;IACf,oBAAoB,EAAG,WAAW,CAAC;IAEnC,oBAAoB,CAAC,EAAE,aAAa,CAAC;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,QAAQ,EAAE,QAAQ,CAAC;IAE1B,OAAO;IAGP,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAA0B;WAE/B,QAAQ,IAAI,OAAO,CAAC,WAAW,CAAC;IAQpD,+EAA+E;IAC/E,OAAO,CAAC,uBAAuB;YAMjB,UAAU;CAoCzB"}
1
+ {"version":3,"file":"TestContext.d.ts","sourceRoot":"","sources":["../../../src/frontend/setup/TestContext.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAoB,MAAM,qBAAqB,CAAC;AAKpE,OAAO,EAAoB,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEnE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAIhD,qBAAa,WAAW;IACf,oBAAoB,EAAG,WAAW,CAAC;IAEnC,oBAAoB,CAAC,EAAE,aAAa,CAAC;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,QAAQ,EAAE,QAAQ,CAAC;IAE1B,OAAO;IAGP,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAA0B;WAE/B,QAAQ,IAAI,OAAO,CAAC,WAAW,CAAC;IAQpD,+EAA+E;IAC/E,OAAO,CAAC,uBAAuB;YAMjB,UAAU;CAqCzB"}
@@ -13,6 +13,7 @@ const Settings_1 = require("../../common/Settings");
13
13
  const SideChannels_1 = require("../../common/SideChannels");
14
14
  const IModelSession_1 = require("./IModelSession");
15
15
  const core_common_1 = require("@itwin/core-common");
16
+ const imodelhub_client_1 = require("@bentley/imodelhub-client");
16
17
  class TestContext {
17
18
  constructor(env) {
18
19
  this.settings = new Settings_1.Settings(env);
@@ -55,6 +56,7 @@ class TestContext {
55
56
  await core_frontend_1.NoRenderApp.startup({
56
57
  applicationId: this.settings.gprid,
57
58
  authorizationClient: new frontend_1.TestFrontendAuthorizationClient(this.adminUserAccessToken),
59
+ hubAccess: new imodelhub_client_1.IModelHubFrontend(),
58
60
  });
59
61
  console.log("TestSetup: Done"); // eslint-disable-line
60
62
  }
@@ -1 +1 @@
1
- {"version":3,"file":"TestContext.js","sourceRoot":"","sources":["../../../src/frontend/setup/TestContext.ts"],"names":[],"mappings":";AA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CAAC,IAAI,CAAC,oBAAoB,CAAC;SACpF,CAAC,CAAC;QAEH,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAE,sBAAsB;IACzD,CAAC;;AA/DH,kCAgEC;AArDgB,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\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) {\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 await NoRenderApp.startup({\r\n applicationId: this.settings.gprid,\r\n authorizationClient: new TestFrontendAuthorizationClient(this.adminUserAccessToken),\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,sDAAoE;AACpE,wDAAmD;AACnD,uEAEkD;AAClD,oDAAmE;AACnE,4DAAqE;AACrE,mDAAgD;AAChD,oDAAyE;AACzE,gEAA8D;AAE9D,MAAa,WAAW;IAQtB,YAAoB,GAAsB;QACxC,IAAI,CAAC,QAAQ,GAAG,IAAI,mBAAQ,CAAC,GAAG,CAAC,CAAC;IACpC,CAAC;IAGM,MAAM,CAAC,KAAK,CA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,EAAC;gBAC1D,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK;gBACnC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ;aACnB,EAAE;gBACxB,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,YAAY;gBACpC,WAAW,EAAE,IAAI,CAAC,QAAQ,CAAC,YAAY;gBACvC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,UAAU;gBAC/B,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC,aAAa;aACQ,CAAC,CAAC;SACnD;QAED,MAAM,UAAU,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;QAExC,IAAI,CAAC,oBAAoB,GAAG,MAAM,6BAAa,CAAC,MAAM,CAAC,IAAI,CAAC,oBAAoB,EAAE,UAAU,CAAC,CAAC;QAC9F,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC;QAEjD,IAAI,CAAC,uBAAuB,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;QAE5G,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,oCAAiB,EAAE;SACnC,CAAC,CAAC;QAEH,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAE,sBAAsB;IACzD,CAAC;;AAhEH,kCAiEC;AAtDgB,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 { IModelHubFrontend } from \"@bentley/imodelhub-client\";\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) {\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 await NoRenderApp.startup({\r\n applicationId: this.settings.gprid,\r\n authorizationClient: new TestFrontendAuthorizationClient(this.adminUserAccessToken),\r\n hubAccess: new IModelHubFrontend(),\r\n });\r\n\r\n console.log(\"TestSetup: Done\"); // eslint-disable-line\r\n }\r\n}\r\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/ecschema-rpcinterface-tests",
3
- "version": "3.0.0-dev.146",
3
+ "version": "3.0.0-dev.151",
4
4
  "description": "Integration tests for the Schema RPC Interface",
5
5
  "author": {
6
6
  "name": "Bentley Systems, Inc.",
@@ -11,20 +11,20 @@
11
11
  "url": "https://github.com/iTwin/itwinjs-core/tree/master/full-stack-tests/ecschema-rpc-interface"
12
12
  },
13
13
  "dependencies": {
14
- "@bentley/imodelhub-client": "3.0.0-dev.146",
15
- "@bentley/itwin-client": "3.0.0-dev.146",
16
- "@itwin/build-tools": "3.0.0-dev.146",
17
- "@itwin/certa": "3.0.0-dev.146",
18
- "@itwin/core-bentley": "3.0.0-dev.146",
19
- "@itwin/core-common": "3.0.0-dev.146",
20
- "@itwin/core-frontend": "3.0.0-dev.146",
21
- "@itwin/core-geometry": "3.0.0-dev.146",
22
- "@itwin/core-quantity": "3.0.0-dev.146",
23
- "@itwin/ecschema-metadata": "3.0.0-dev.146",
24
- "@itwin/ecschema-rpcinterface-common": "3.0.0-dev.146",
14
+ "@bentley/imodelhub-client": "3.0.0-dev.151",
15
+ "@bentley/itwin-client": "3.0.0-dev.151",
16
+ "@itwin/build-tools": "3.0.0-dev.151",
17
+ "@itwin/certa": "3.0.0-dev.151",
18
+ "@itwin/core-bentley": "3.0.0-dev.151",
19
+ "@itwin/core-common": "3.0.0-dev.151",
20
+ "@itwin/core-frontend": "3.0.0-dev.151",
21
+ "@itwin/core-geometry": "3.0.0-dev.151",
22
+ "@itwin/core-quantity": "3.0.0-dev.151",
23
+ "@itwin/ecschema-metadata": "3.0.0-dev.151",
24
+ "@itwin/ecschema-rpcinterface-common": "3.0.0-dev.151",
25
25
  "@itwin/oidc-signin-tool": "3.0.0-dev.110",
26
- "@itwin/presentation-common": "3.0.0-dev.146",
27
- "@itwin/presentation-frontend": "3.0.0-dev.146",
26
+ "@itwin/presentation-common": "3.0.0-dev.151",
27
+ "@itwin/presentation-frontend": "3.0.0-dev.151",
28
28
  "chai": "^4.1.2",
29
29
  "chai-as-promised": "^7",
30
30
  "dotenv": "^10.0.0",
@@ -34,9 +34,9 @@
34
34
  "puppeteer": "chrome-86"
35
35
  },
36
36
  "devDependencies": {
37
- "@itwin/core-backend": "3.0.0-dev.146",
38
- "@itwin/eslint-plugin": "3.0.0-dev.146",
39
- "@itwin/express-server": "3.0.0-dev.146",
37
+ "@itwin/core-backend": "3.0.0-dev.151",
38
+ "@itwin/eslint-plugin": "3.0.0-dev.151",
39
+ "@itwin/express-server": "3.0.0-dev.151",
40
40
  "@itwin/projects-client": "^0.2.0",
41
41
  "@types/chai": "^4.1.4",
42
42
  "@types/chai-as-promised": "^7",