@itwin/ecschema-rpcinterface-tests 3.0.0-dev.72 → 3.0.0-dev.78
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.
- package/lib/common/Settings.d.ts +3 -3
- package/lib/common/Settings.d.ts.map +1 -1
- package/lib/common/Settings.js +3 -3
- package/lib/common/Settings.js.map +1 -1
- package/lib/dist/bundled-tests.js +13839 -18708
- package/lib/dist/bundled-tests.js.map +1 -1
- package/lib/frontend/setup/IModelSession.d.ts.map +1 -1
- package/lib/frontend/setup/IModelSession.js +10 -11
- package/lib/frontend/setup/IModelSession.js.map +1 -1
- package/lib/frontend/setup/TestContext.d.ts.map +1 -1
- package/lib/frontend/setup/TestContext.js +0 -2
- package/lib/frontend/setup/TestContext.js.map +1 -1
- package/package.json +23 -23
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IModelSession.d.ts","sourceRoot":"","sources":["../../../src/frontend/setup/IModelSession.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAG5D,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,qBAAa,aAAa;IAEjB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IAE5B,OAAO,CAAC,OAAO,CAAC,CAAuB;gBAEpB,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM;WAMtD,MAAM,CAAC,cAAc,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,aAAa,CAAC;IAsC1F,aAAa,IAAI,OAAO,CAAC,oBAAoB,CAAC;IAI9C,IAAI,IAAI,OAAO,CAAC,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"IModelSession.d.ts","sourceRoot":"","sources":["../../../src/frontend/setup/IModelSession.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAG5D,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,qBAAa,aAAa;IAEjB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IAE5B,OAAO,CAAC,OAAO,CAAC,CAAuB;gBAEpB,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM;WAMtD,MAAM,CAAC,cAAc,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,aAAa,CAAC;IAsC1F,aAAa,IAAI,OAAO,CAAC,oBAAoB,CAAC;IAI9C,IAAI,IAAI,OAAO,CAAC,oBAAoB,CAAC;CAYnD"}
|
|
@@ -8,7 +8,7 @@ exports.IModelSession = void 0;
|
|
|
8
8
|
const chai_1 = require("chai");
|
|
9
9
|
const core_frontend_1 = require("@itwin/core-frontend");
|
|
10
10
|
const imodelhub_client_1 = require("@bentley/imodelhub-client");
|
|
11
|
-
const
|
|
11
|
+
const itwin_registry_client_1 = require("@bentley/itwin-registry-client");
|
|
12
12
|
class IModelSession {
|
|
13
13
|
constructor(iModelId, iTwinId, changesetId) {
|
|
14
14
|
this.iTwinId = iTwinId;
|
|
@@ -19,23 +19,23 @@ class IModelSession {
|
|
|
19
19
|
let contextId;
|
|
20
20
|
let imodelId;
|
|
21
21
|
// Turn the iTwin name into an id
|
|
22
|
-
if (iModelData.
|
|
23
|
-
const client = new
|
|
22
|
+
if (iModelData.useITwinName && iModelData.iTwinName) {
|
|
23
|
+
const client = new itwin_registry_client_1.ITwinAccessClient();
|
|
24
24
|
const iTwinList = await client.getAll(requestContext, {
|
|
25
25
|
search: {
|
|
26
|
-
searchString: iModelData.
|
|
27
|
-
propertyName:
|
|
26
|
+
searchString: iModelData.iTwinName,
|
|
27
|
+
propertyName: itwin_registry_client_1.ITwinSearchableProperty.Name,
|
|
28
28
|
exactMatch: true,
|
|
29
29
|
},
|
|
30
30
|
});
|
|
31
31
|
if (iTwinList.length === 0)
|
|
32
|
-
throw new Error(`ITwin ${iModelData.
|
|
32
|
+
throw new Error(`ITwin ${iModelData.iTwinName} was not found for the user.`);
|
|
33
33
|
else if (iTwinList.length > 1)
|
|
34
|
-
throw new Error(`Multiple iTwins named ${iModelData.
|
|
34
|
+
throw new Error(`Multiple iTwins named ${iModelData.iTwinName} were found for the user.`);
|
|
35
35
|
contextId = iTwinList[0].id;
|
|
36
36
|
}
|
|
37
37
|
else
|
|
38
|
-
contextId = iModelData.
|
|
38
|
+
contextId = iModelData.iTwinId;
|
|
39
39
|
if (iModelData.useName) {
|
|
40
40
|
const imodelClient = new imodelhub_client_1.IModelHubClient();
|
|
41
41
|
const imodels = await imodelClient.iModels.get(requestContext, contextId, new imodelhub_client_1.IModelQuery().byName(iModelData.name));
|
|
@@ -45,7 +45,7 @@ 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.
|
|
48
|
+
console.log(`Using iModel { name:${iModelData.name}, id:${iModelData.id}, projectId:${iModelData.iTwinId}, changesetId:${iModelData.changeSetId} }`); // eslint-disable-line no-console
|
|
49
49
|
return new IModelSession(contextId, imodelId, iModelData.changeSetId);
|
|
50
50
|
}
|
|
51
51
|
async getConnection() {
|
|
@@ -53,9 +53,8 @@ class IModelSession {
|
|
|
53
53
|
}
|
|
54
54
|
async open() {
|
|
55
55
|
try {
|
|
56
|
-
const env = process.env.IMJS_BUDDI_RESOLVE_URL_USING_REGION;
|
|
57
56
|
// eslint-disable-next-line no-console
|
|
58
|
-
console.log(`Environment: ${env}`);
|
|
57
|
+
console.log(`Environment: ${process.env.IMJS_URL_PREFIX}`);
|
|
59
58
|
this._iModel = await core_frontend_1.CheckpointConnection.openRemote(this.iTwinId, this.iModelId);
|
|
60
59
|
(0, chai_1.expect)(this._iModel).to.exist;
|
|
61
60
|
}
|
|
@@ -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,
|
|
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,0EAAmG;AAInG,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,yCAAiB,EAAE,CAAC;YACvC,MAAM,SAAS,GAAY,MAAM,MAAM,CAAC,MAAM,CAAC,cAAc,EAAE;gBAC7D,MAAM,EAAE;oBACN,YAAY,EAAE,UAAU,CAAC,SAAS;oBAClC,YAAY,EAAE,+CAAuB,CAAC,IAAI;oBAC1C,UAAU,EAAE,IAAI;iBACjB;aACF,CAAC,CAAC;YAEH,IAAI,SAAS,CAAC,M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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":["/*---------------------------------------------------------------------------------------------\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 { IModelHubClient, IModelQuery } from \"@bentley/imodelhub-client\";\nimport { ITwin, ITwinAccessClient, ITwinSearchableProperty } from \"@bentley/itwin-registry-client\";\nimport { IModelData } from \"../../common/Settings\";\nimport { AccessToken } from \"@itwin/core-bentley\";\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(requestContext: AccessToken, iModelData: IModelData): Promise<IModelSession> {\n let contextId;\n let imodelId;\n\n // Turn the iTwin name into an id\n if (iModelData.useITwinName && iModelData.iTwinName) {\n const client = new ITwinAccessClient();\n const iTwinList: ITwin[] = await client.getAll(requestContext, {\n search: {\n searchString: iModelData.iTwinName,\n propertyName: ITwinSearchableProperty.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 contextId = iTwinList[0].id;\n } else\n contextId = iModelData.iTwinId!;\n\n if (iModelData.useName) {\n const imodelClient = new IModelHubClient();\n const imodels = await imodelClient.iModels.get(requestContext, contextId, new IModelQuery().byName(iModelData.name!));\n if (undefined === imodels || imodels.length === 0)\n throw new Error(`The iModel ${iModelData.name} does not exist in project ${contextId}.`);\n imodelId = imodels[0].wsgId;\n } else\n imodelId = iModelData.id!;\n\n console.log(`Using iModel { name:${iModelData.name}, id:${iModelData.id}, projectId:${iModelData.iTwinId}, changesetId:${iModelData.changeSetId} }`); // eslint-disable-line no-console\n\n return new IModelSession(contextId, imodelId, 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 +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;
|
|
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;CAmCzB"}
|
|
@@ -37,8 +37,6 @@ class TestContext {
|
|
|
37
37
|
// Configure iModel.js frontend logging to go to the console
|
|
38
38
|
core_bentley_1.Logger.initializeToConsole();
|
|
39
39
|
core_bentley_1.Logger.setLevelDefault(this.settings.logLevel === undefined ? core_bentley_1.LogLevel.Warning : this.settings.logLevel);
|
|
40
|
-
// Setup environment
|
|
41
|
-
process.env.IMJS_BUDDI_RESOLVE_URL_USING_REGION = String(this.settings.env);
|
|
42
40
|
if (undefined !== this.settings.oidcClientId) {
|
|
43
41
|
this.adminUserAccessToken = await (0, frontend_1.getAccessTokenFromBackend)({
|
|
44
42
|
email: this.settings.users[0].email,
|
|
@@ -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,mEAE8C;AAC9C,oDAAmE;AACnE,4DAAqE;AACrE,mDAAgD;AAChD,oDAAyE;AAEzE,MAAa,WAAW;IAQtB,YAAoB,GAAsB;QACxC,IAAI,CAAC,QAAQ,GAAG,IAAI,mBAAQ,CAAC,GAAG,CAAC,CAAC;IACpC,CAAC;IAGM,MAAM,CAAC,KAAK,CAAC,QAAQ;QAC1B,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS,EAAE;YAChC,IAAI,CAAC,SAAS,GAAG,IAAI,WAAW,CAAC,MAAM,IAAA,uCAAwB,GAAE,CAAC,CAAC;YACnE,MAAM,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC;SACnC;QACD,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED,+EAA+E;IACvE,uBAAuB,CAAC,IAAiB;QAC/C,6BAA6B;QAC7B,MAAM,SAAS,GAAW,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAC5E,oCAAsB,CAAC,gBAAgB,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,IAAA,2BAAgB,GAAE,CAAC,CAAC;IACnF,CAAC;IAEO,KAAK,CAAC,UAAU;QACtB,IAAA,aAAM,EAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,sDAAsD,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,uBAAuB,CAAC,CAAC;QAEzJ,8BAA8B;QAC9B,OAAO,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9F,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;SACpF,CAAC,CAAC;QAEH,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAE,sBAAsB;IACzD,CAAC;;AA9DH,kCA+DC;AApDgB,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/frontend\";\nimport { getRpcInterfaces, Settings } from \"../../common/Settings\";\nimport { getProcessEnvFromBackend } from \"../../common/SideChannels\";\nimport { IModelSession } from \"./IModelSession\";\nimport { BentleyCloudRpcManager, OpenAPIInfo } from \"@itwin/core-common\";\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) {\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 iModel.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 } 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 await NoRenderApp.startup({\n applicationId: this.settings.gprid,\n authorizationClient: new TestFrontendAuthorizationClient(this.adminUserAccessToken),\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.0.0-dev.
|
|
3
|
+
"version": "3.0.0-dev.78",
|
|
4
4
|
"description": "Integration tests for the Schema RPC Interface",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Bentley Systems, Inc.",
|
|
@@ -11,23 +11,22 @@
|
|
|
11
11
|
"url": "https://github.com/imodeljs/imodeljs/tree/master/full-stack-tests/ecschema-rpc-interface"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@bentley/backend-itwin-client": "3.0.0-dev.
|
|
15
|
-
"@itwin/core-bentley": "3.0.0-dev.
|
|
16
|
-
"@itwin/build-tools": "3.0.0-dev.
|
|
17
|
-
"@itwin/certa": "3.0.0-dev.
|
|
18
|
-
"@
|
|
19
|
-
"@itwin/ecschema-
|
|
20
|
-
"@itwin/
|
|
21
|
-
"@
|
|
22
|
-
"@
|
|
23
|
-
"@itwin/core-
|
|
24
|
-
"@itwin/core-
|
|
25
|
-
"@itwin/core-
|
|
26
|
-
"@itwin
|
|
27
|
-
"@
|
|
28
|
-
"@itwin/
|
|
29
|
-
"@itwin/presentation-
|
|
30
|
-
"@itwin/presentation-frontend": "3.0.0-dev.72",
|
|
14
|
+
"@bentley/backend-itwin-client": "3.0.0-dev.78",
|
|
15
|
+
"@itwin/core-bentley": "3.0.0-dev.78",
|
|
16
|
+
"@itwin/build-tools": "3.0.0-dev.78",
|
|
17
|
+
"@itwin/certa": "3.0.0-dev.78",
|
|
18
|
+
"@itwin/ecschema-metadata": "3.0.0-dev.78",
|
|
19
|
+
"@itwin/ecschema-rpcinterface-common": "3.0.0-dev.78",
|
|
20
|
+
"@itwin/core-geometry": "3.0.0-dev.78",
|
|
21
|
+
"@bentley/imodelhub-client": "3.0.0-dev.78",
|
|
22
|
+
"@itwin/core-common": "3.0.0-dev.78",
|
|
23
|
+
"@itwin/core-frontend": "3.0.0-dev.78",
|
|
24
|
+
"@itwin/core-i18n": "3.0.0-dev.78",
|
|
25
|
+
"@itwin/core-quantity": "3.0.0-dev.78",
|
|
26
|
+
"@bentley/itwin-client": "3.0.0-dev.78",
|
|
27
|
+
"@itwin/oidc-signin-tool": "3.0.0-dev.78",
|
|
28
|
+
"@itwin/presentation-common": "3.0.0-dev.78",
|
|
29
|
+
"@itwin/presentation-frontend": "3.0.0-dev.78",
|
|
31
30
|
"chai": "^4.1.2",
|
|
32
31
|
"chai-as-promised": "^7",
|
|
33
32
|
"dotenv": "^10.0.0",
|
|
@@ -37,9 +36,10 @@
|
|
|
37
36
|
"puppeteer": "chrome-86"
|
|
38
37
|
},
|
|
39
38
|
"devDependencies": {
|
|
40
|
-
"@itwin/eslint-plugin": "3.0.0-dev.
|
|
41
|
-
"@itwin/express-server": "3.0.0-dev.
|
|
42
|
-
"@itwin/core-backend": "3.0.0-dev.
|
|
39
|
+
"@itwin/eslint-plugin": "3.0.0-dev.78",
|
|
40
|
+
"@itwin/express-server": "3.0.0-dev.78",
|
|
41
|
+
"@itwin/core-backend": "3.0.0-dev.78",
|
|
42
|
+
"@bentley/itwin-registry-client": "3.0.0-dev.78",
|
|
43
43
|
"@types/chai": "^4.1.4",
|
|
44
44
|
"@types/chai-as-promised": "^7",
|
|
45
45
|
"@types/mocha": "^8.2.2",
|
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
"extends": "plugin:@itwin/itwinjs-recommended"
|
|
64
64
|
},
|
|
65
65
|
"scripts": {
|
|
66
|
-
"compile": "npm run build",
|
|
67
|
-
"build": "tsc 1>&2 && npm run webpack:frontend",
|
|
66
|
+
"compile": "npm run -s build",
|
|
67
|
+
"build": "tsc 1>&2 && npm run -s webpack:frontend",
|
|
68
68
|
"clean": "rimraf lib .rush/temp/package-deps*.json integration_test_results",
|
|
69
69
|
"copy:config": "internal-tools copy-config",
|
|
70
70
|
"cover": "",
|