@itwin/rpcinterface-full-stack-tests 5.0.0-dev.65 → 5.0.0-dev.67
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/backend/BackendInit.js.map +1 -1
- package/lib/common/Settings.js +12 -12
- package/lib/common/Settings.js.map +1 -1
- package/lib/common/SideChannels.js.map +1 -1
- package/lib/dist/bundled-tests.js +102 -52
- package/lib/dist/bundled-tests.js.map +1 -1
- package/lib/frontend/CodeSpecs.test.js.map +1 -1
- package/lib/frontend/DevToolsRpc.test.js.map +1 -1
- package/lib/frontend/Elements.test.js.map +1 -1
- package/lib/frontend/IModel.test.js.map +1 -1
- package/lib/frontend/IModelConnection.test.js.map +1 -1
- package/lib/frontend/Models.test.js.map +1 -1
- package/lib/frontend/PresentationRpc.test.js.map +1 -1
- package/lib/frontend/Views.test.js.map +1 -1
- package/lib/frontend/setup/IModelSession.js.map +1 -1
- package/lib/frontend/setup/TestContext.js.map +1 -1
- package/lib/frontend/workflows/BasicScenarios.test.js.map +1 -1
- package/package.json +13 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackendInit.js","sourceRoot":"","sources":["../../src/backend/BackendInit.ts"],"names":[],"mappings":";;AAAA;;;+FAG+F;AAC/F,8DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAC7B,yDAAgE;AAChE,yBAAyB;AAEzB,sDAAsD;AACtD,SAAS,OAAO,CAAC,OAAe;IAC9B,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC;QACzB,OAAO;IAET,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,4DAA4D;IAC9F,MAAM,YAAY,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,4DAA4D;IAC3G,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;IACnD,IAAI,SAAS,CAAC,KAAK,EAAE,CAAC;QACpB,MAAM,SAAS,CAAC,KAAK,CAAC;IACxB,CAAC;IAED,YAAY,CAAC,SAAS,CAAC,CAAC;AAC1B,CAAC;AAED,MAAM,CAAC,OAAO,GAAG,CAAC,KAAK,IAAI,EAAE;IAC3B,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;IAElD,IAAA,qCAAsB,GAAE,CAAC;AAC3B,CAAC,CAAC,EAAE,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"BackendInit.js","sourceRoot":"","sources":["../../src/backend/BackendInit.ts"],"names":[],"mappings":";;AAAA;;;+FAG+F;AAC/F,8DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAC7B,yDAAgE;AAChE,yBAAyB;AAEzB,sDAAsD;AACtD,SAAS,OAAO,CAAC,OAAe;IAC9B,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC;QACzB,OAAO;IAET,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,4DAA4D;IAC9F,MAAM,YAAY,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,4DAA4D;IAC3G,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;IACnD,IAAI,SAAS,CAAC,KAAK,EAAE,CAAC;QACpB,MAAM,SAAS,CAAC,KAAK,CAAC;IACxB,CAAC;IAED,YAAY,CAAC,SAAS,CAAC,CAAC;AAC1B,CAAC;AAED,MAAM,CAAC,OAAO,GAAG,CAAC,KAAK,IAAI,EAAE;IAC3B,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;IAElD,IAAA,qCAAsB,GAAE,CAAC;AAC3B,CAAC,CAAC,EAAE,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*--------------------------------------------------------------------------------------------*/\nimport \"@itwin/oidc-signin-tool/lib/cjs/certa/certaBackend\";\n// Sets up certa to allow a method on the frontend to get an access token\nimport * as path from \"path\";\nimport { exposeBackendCallbacks } from \"../common/SideChannels\";\nimport * as fs from \"fs\";\n\n/** Loads the provided `.env` file into process.env */\nfunction loadEnv(envFile: string) {\n if (!fs.existsSync(envFile))\n return;\n\n const dotenv = require(\"dotenv\"); // eslint-disable-line @typescript-eslint/no-require-imports\n const dotenvExpand = require(\"dotenv-expand\"); // eslint-disable-line @typescript-eslint/no-require-imports\n const envResult = dotenv.config({ path: envFile });\n if (envResult.error) {\n throw envResult.error;\n }\n\n dotenvExpand(envResult);\n}\n\nmodule.exports = (async () => {\n loadEnv(path.join(__dirname, \"..\", \"..\", \".env\"));\n\n exposeBackendCallbacks();\n})();\n"]}
|
package/lib/common/Settings.js
CHANGED
|
@@ -144,18 +144,18 @@ class Settings {
|
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
toString() {
|
|
147
|
-
return `Configurations:
|
|
148
|
-
backend location: ${this.Backend.location},
|
|
149
|
-
backend name: ${this.Backend.name},
|
|
150
|
-
backend version: ${this.Backend.version},
|
|
151
|
-
oidc client id: ${this.oidcClientId},
|
|
152
|
-
oidc scopes: ${this.oidcScopes},
|
|
153
|
-
applicationId: ${this.gprid},
|
|
154
|
-
log level: ${this.logLevel},
|
|
155
|
-
testing iModelTileRpcTests: ${this.runiModelTileRpcTests},
|
|
156
|
-
testing PresentationRpcTest: ${this.runPresentationRpcTests},
|
|
157
|
-
testing iModelReadRpcTests: ${this.runiModelReadRpcTests},
|
|
158
|
-
testing DevToolsRpcTests: ${this.runDevToolsRpcTests},
|
|
147
|
+
return `Configurations:
|
|
148
|
+
backend location: ${this.Backend.location},
|
|
149
|
+
backend name: ${this.Backend.name},
|
|
150
|
+
backend version: ${this.Backend.version},
|
|
151
|
+
oidc client id: ${this.oidcClientId},
|
|
152
|
+
oidc scopes: ${this.oidcScopes},
|
|
153
|
+
applicationId: ${this.gprid},
|
|
154
|
+
log level: ${this.logLevel},
|
|
155
|
+
testing iModelTileRpcTests: ${this.runiModelTileRpcTests},
|
|
156
|
+
testing PresentationRpcTest: ${this.runPresentationRpcTests},
|
|
157
|
+
testing iModelReadRpcTests: ${this.runiModelReadRpcTests},
|
|
158
|
+
testing DevToolsRpcTests: ${this.runDevToolsRpcTests},
|
|
159
159
|
testing iModelWriteRpcTests: ${this.runiModelWriteRpcTests}`;
|
|
160
160
|
}
|
|
161
161
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Settings.js","sourceRoot":"","sources":["../../src/common/Settings.ts"],"names":[],"mappings":";;;AA8BA,4CAYC;AArCD,sDAA+C;AAC/C,oDAA0G;AAE1G,oEAAsE;AAsBtE,SAAgB,gBAAgB,CAAC,QAAkB;IACjD,MAAM,aAAa,GAAG,EAAE,CAAC;IACzB,IAAI,QAAQ,CAAC,mBAAmB;QAC9B,aAAa,CAAC,IAAI,CAAC,kCAAoB,CAAC,CAAC;IAC3C,IAAI,QAAQ,CAAC,uBAAuB;QAClC,aAAa,CAAC,IAAI,CAAC,8CAAwB,CAAC,CAAC;IAC/C,IAAI,QAAQ,CAAC,qBAAqB;QAChC,aAAa,CAAC,IAAI,CAAC,oCAAsB,CAAC,CAAC;IAC7C,IAAI,QAAQ,CAAC,qBAAqB;QAChC,aAAa,CAAC,IAAI,CAAC,oCAAsB,CAAC,CAAC;IAE7C,OAAO,aAAa,CAAC;AACvB,CAAC;AAED,SAAS,YAAY,CAAC,WAA+B;IACnD,IAAI,SAAS,KAAK,WAAW;QAC3B,OAAO,KAAK,CAAC;IAEf,MAAM,KAAK,GAAG,OAAO,CAAC;IACtB,OAAO,KAAK,CAAC,IAAI,CAAC,WAAW,C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AAC,UAAU;uBACb,IAAI,CAAC,KAAK;mBACd,IAAI,CAAC,QAAQ;oCACI,IAAI,CAAC,qBAAqB;qCACzB,IAAI,CAAC,uBAAuB;oCAC7B,IAAI,CAAC,qBAAqB;kCAC5B,IAAI,CAAC,mBAAmB;qCACrB,IAAI,CAAC,sBAAsB,EAAE,CAAC;IACjE,CAAC;CACF;AAjKD,4BAiKC","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 { ServiceAuthorizationClientConfiguration } from \"@itwin/service-authorization\";\r\nimport { LogLevel } from \"@itwin/core-bentley\";\r\nimport { DevToolsRpcInterface, IModelReadRpcInterface, IModelTileRpcInterface } from \"@itwin/core-common\";\r\nimport { TestUserCredentials } from \"@itwin/oidc-signin-tool\";\r\nimport { PresentationRpcInterface } from \"@itwin/presentation-common\";\r\n\r\nexport interface Backend {\r\n version: string;\r\n location: string;\r\n name: string;\r\n path: string;\r\n}\r\n\r\n/**\r\n * Holds the information required to u identify an iModel\r\n */\r\nexport interface IModelData {\r\n useName: boolean; // Defines whether or not to use the name of the iModel\r\n id?: string; // The iModel Id - This is not required\r\n name?: string; // The name is not required to actually get the iModel, only the id.\r\n useITwinName: boolean;\r\n iTwinId?: string;\r\n iTwinName?: string;\r\n changeSetId?: string;\r\n}\r\n\r\nexport function getRpcInterfaces(settings: Settings) {\r\n const rpcInterfaces = [];\r\n if (settings.runDevToolsRpcTests)\r\n rpcInterfaces.push(DevToolsRpcInterface);\r\n if (settings.runPresentationRpcTests)\r\n rpcInterfaces.push(PresentationRpcInterface);\r\n if (settings.runiModelReadRpcTests)\r\n rpcInterfaces.push(IModelReadRpcInterface);\r\n if (settings.runiModelTileRpcTests)\r\n rpcInterfaces.push(IModelTileRpcInterface);\r\n\r\n return rpcInterfaces;\r\n}\r\n\r\nfunction checkEnabled(envVariable: string | undefined): boolean {\r\n if (undefined === envVariable)\r\n return false;\r\n\r\n const regex = /true/i;\r\n return regex.test(envVariable);\r\n}\r\n\r\nexport class Settings {\r\n private _backend: Backend = {} as Backend;\r\n public env: number = 0;\r\n public oidcClientId!: string;\r\n public oidcScopes!: string;\r\n public oidcRedirect!: string;\r\n public oidcAuthority?: string;\r\n public gprid?: string;\r\n public logLevel?: number;\r\n public users: TestUserCredentials[] = [];\r\n public clientConfiguration?: ServiceAuthorizationClientConfiguration;\r\n\r\n public iModels: IModelData[] = [];\r\n public get iModel(): IModelData { return this.iModels[0]; }\r\n public get writeIModel(): IModelData { return this.iModels[1]; }\r\n public get user(): TestUserCredentials { return this.users[0]; }\r\n\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n public get Backend(): Backend { return this._backend; }\r\n\r\n public get runiModelTileRpcTests(): boolean { return checkEnabled(process.env.RPC_IMODELTILE_ENABLE); }\r\n public get runPresentationRpcTests(): boolean { return checkEnabled(process.env.RPC_PRESENTATION_ENABLE); }\r\n public get runiModelReadRpcTests(): boolean { return checkEnabled(process.env.RPC_IMODELREAD_ENABLE); }\r\n public get runiModelWriteRpcTests(): boolean { return checkEnabled(process.env.RPC_IMODELWRITE_ENABLE); }\r\n public get runDevToolsRpcTests(): boolean { return checkEnabled(process.env.RPC_DEVTOOLS_ENABLE); }\r\n\r\n constructor(env: NodeJS.ProcessEnv) {\r\n const isFrontend = (typeof (process) === \"undefined\");\r\n if (!isFrontend && undefined === env.TF_BUILD) {\r\n const path = require(\"path\"); // eslint-disable-line @typescript-eslint/no-require-imports\r\n const dotenv = require(\"dotenv\"); // eslint-disable-line @typescript-eslint/no-require-imports\r\n const dotenvExpand = require(\"dotenv-expand\"); // eslint-disable-line @typescript-eslint/no-require-imports\r\n // First check in process.cwd() for the config\r\n let result = dotenv.config();\r\n if (result.error) {\r\n const potential = path.resolve(process.cwd(), \"..\", \"..\", \"..\", \"imodeljs-config\", \".env\");\r\n result = dotenv.config({ path: potential });\r\n if (result.error)\r\n throw result.error;\r\n }\r\n\r\n dotenvExpand(result);\r\n }\r\n\r\n if (isFrontend)\r\n globalThis.process = { browser: true, env } as any;\r\n\r\n // Loads the config out of the environment.\r\n this.load();\r\n }\r\n\r\n /** Loads the necessary variables from `process.env`.\r\n */\r\n private load() {\r\n // Parse OIDC\r\n if (undefined === process.env.OIDC_CLIENT_ID)\r\n throw new Error(\"Missing the 'OIDC_CLIENT_ID' setting.\");\r\n this.oidcClientId = process.env.OIDC_CLIENT_ID!;\r\n\r\n if (undefined === process.env.OIDC_SCOPES)\r\n throw new Error(\"Missing the 'OIDC_SCOPES' setting\");\r\n this.oidcScopes = process.env.OIDC_SCOPES;\r\n\r\n if (process.env.OIDC_AUTHORITY)\r\n this.oidcAuthority = process.env.OIDC_AUTHORITY;\r\n\r\n this.oidcRedirect = (undefined === process.env.OIDC_REDIRECT) ? \"http://localhost:5000\" : process.env.OIDC_REDIRECT;\r\n\r\n // Parse GPRId\r\n if (undefined !== process.env.GPRID)\r\n this.gprid = process.env.GPRID;\r\n\r\n // Parse the iModel variables\r\n if (!process.env.IMODEL_PROJECTID && !process.env.IMODEL_PROJECTNAME)\r\n throw new Error(\"Missing the 'IMODEL_PROJECTID' or 'IMODEL_PROJECTNAME' setting.\");\r\n\r\n if (!process.env.IMODEL_IMODELID && !process.env.IMODEL_IMODELNAME)\r\n throw new Error(\"Missing the 'IMODEL_IMODELID' or 'IMODEL_IMODELNAME' setting.\");\r\n\r\n // Note: This is kind of messy but we don't sign-in to resolve the Names into IDs until the TestContext.\r\n this.iModels.push({\r\n useName: !process.env.IMODEL_IMODELID,\r\n id: process.env.IMODEL_IMODELID,\r\n name: process.env.IMODEL_IMODELNAME,\r\n useITwinName: !process.env.IMODEL_PROJECTID,\r\n iTwinId: process.env.IMODEL_PROJECTID,\r\n iTwinName: process.env.IMODEL_PROJECTNAME,\r\n\r\n // Neither of the next 2 are needed but since they'll be undefined anyway, just always set it.\r\n changeSetId: process.env.IMODEL_CHANGESETID,\r\n });\r\n\r\n // If write rpc interface is defined expect a separate iModel to be used.\r\n if (this.runiModelWriteRpcTests) {\r\n if (!process.env.IMODEL_WRITE_PROJECTID && !process.env.IMODEL_WRITE_PROJECTNAME)\r\n throw new Error(\"Missing the 'IMODEL_WRITE_PROJECTID' or 'IMODEL_WRITE_PROJECTNAME' setting.\");\r\n\r\n if (!process.env.IMODEL_WRITE_IMODELID && !process.env.IMODEL_WRITE_IMODELNAME)\r\n throw new Error(\"Missing the 'IMODEL_WRITE_IMODELID' or 'IMODEL_WRITE_IMODELNAME' setting.\");\r\n\r\n this.iModels.push({\r\n useName: !process.env.IMODEL_WRITE_IMODELID,\r\n id: process.env.IMODEL_WRITE_IMODELID,\r\n name: process.env.IMODEL_WRITE_IMODELNAME,\r\n useITwinName: !process.env.IMODEL_WRITE_PROJECTID,\r\n iTwinId: process.env.IMODEL_WRITE_PROJECTID,\r\n iTwinName: process.env.IMODEL_WRITE_PROJECTNAME,\r\n });\r\n }\r\n\r\n // Parse logging level\r\n if (undefined !== process.env.LOG_LEVEL) {\r\n const level = parseInt(process.env.LOG_LEVEL, 10);\r\n if (!isNaN(level) && undefined !== LogLevel[level])\r\n this.logLevel = level;\r\n }\r\n\r\n // Get backend data\r\n if (undefined === process.env.BACKEND_LOCATION)\r\n throw new Error(\"Missing the 'BACKEND_LOCATION' setting.\");\r\n this._backend.location = process.env.BACKEND_LOCATION;\r\n\r\n if (undefined === process.env.BACKEND_VERSION)\r\n throw new Error(\"Missing the 'BACKEND_VERSION' setting.\");\r\n this._backend.version = process.env.BACKEND_VERSION;\r\n\r\n if (undefined === process.env.BACKEND_NAME)\r\n throw new Error(\"Missing the 'BACKEND_NAME' setting.\");\r\n this._backend.name = process.env.BACKEND_NAME;\r\n\r\n // Get users\r\n this.users.push({\r\n email: process.env.USER_WITH_ACCESS_USERNAME || \"\",\r\n password: process.env.USER_WITH_ACCESS_PASSWORD || \"\",\r\n });\r\n\r\n if (undefined !== process.env.CLIENT_WITH_ACCESS_ID && undefined !== process.env.CLIENT_WITH_ACCESS_SECRET && undefined !== process.env.CLIENT_WITH_ACCESS_SCOPES) {\r\n this.clientConfiguration = {\r\n clientId: process.env.CLIENT_WITH_ACCESS_ID,\r\n clientSecret: process.env.CLIENT_WITH_ACCESS_SECRET,\r\n scope: process.env.CLIENT_WITH_ACCESS_SCOPES,\r\n authority: this.oidcAuthority,\r\n };\r\n }\r\n }\r\n\r\n public toString(): string {\r\n return `Configurations:\r\n backend location: ${this.Backend.location},\r\n backend name: ${this.Backend.name},\r\n backend version: ${this.Backend.version},\r\n oidc client id: ${this.oidcClientId},\r\n oidc scopes: ${this.oidcScopes},\r\n applicationId: ${this.gprid},\r\n log level: ${this.logLevel},\r\n testing iModelTileRpcTests: ${this.runiModelTileRpcTests},\r\n testing PresentationRpcTest: ${this.runPresentationRpcTests},\r\n testing iModelReadRpcTests: ${this.runiModelReadRpcTests},\r\n testing DevToolsRpcTests: ${this.runDevToolsRpcTests},\r\n testing iModelWriteRpcTests: ${this.runiModelWriteRpcTests}`;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"Settings.js","sourceRoot":"","sources":["../../src/common/Settings.ts"],"names":[],"mappings":";;;AA8BA,4CAYC;AArCD,sDAA+C;AAC/C,oDAA0G;AAE1G,oEAAsE;AAsBtE,SAAgB,gBAAgB,CAAC,QAAkB;IACjD,MAAM,aAAa,GAAG,EAAE,CAAC;IACzB,IAAI,QAAQ,CAAC,mBAAmB;QAC9B,aAAa,CAAC,IAAI,CAAC,kCAAoB,CAAC,CAAC;IAC3C,IAAI,QAAQ,CAAC,uBAAuB;QAClC,aAAa,CAAC,IAAI,CAAC,8CAAwB,CAAC,CAAC;IAC/C,IAAI,QAAQ,CAAC,qBAAqB;QAChC,aAAa,CAAC,IAAI,CAAC,oCAAsB,CAAC,CAAC;IAC7C,IAAI,QAAQ,CAAC,qBAAqB;QAChC,aAAa,CAAC,IAAI,CAAC,oCAAsB,CAAC,CAAC;IAE7C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ACJ,CAAC;IACH,CAAC;IAEM,QAAQ;QACb,OAAO;0BACe,IAAI,CAAC,OAAO,CAAC,QAAQ;sBACzB,IAAI,CAAC,OAAO,CAAC,IAAI;yBACd,IAAI,CAAC,OAAO,CAAC,OAAO;wBACrB,IAAI,CAAC,YAAY;qBACpB,IAAI,CAAC,UAAU;uBACb,IAAI,CAAC,KAAK;mBACd,IAAI,CAAC,QAAQ;oCACI,IAAI,CAAC,qBAAqB;qCACzB,IAAI,CAAC,uBAAuB;oCAC7B,IAAI,CAAC,qBAAqB;kCAC5B,IAAI,CAAC,mBAAmB;qCACrB,IAAI,CAAC,sBAAsB,EAAE,CAAC;IACjE,CAAC;CACF;AAjKD,4BAiKC","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 { ServiceAuthorizationClientConfiguration } from \"@itwin/service-authorization\";\nimport { LogLevel } from \"@itwin/core-bentley\";\nimport { DevToolsRpcInterface, IModelReadRpcInterface, IModelTileRpcInterface } from \"@itwin/core-common\";\nimport { TestUserCredentials } from \"@itwin/oidc-signin-tool\";\nimport { PresentationRpcInterface } from \"@itwin/presentation-common\";\n\nexport interface Backend {\n version: string;\n location: string;\n name: string;\n path: string;\n}\n\n/**\n * Holds the information required to u identify an iModel\n */\nexport interface IModelData {\n useName: boolean; // Defines whether or not to use the name of the iModel\n id?: string; // The iModel Id - This is not required\n name?: string; // The name is not required to actually get the iModel, only the id.\n useITwinName: boolean;\n iTwinId?: string;\n iTwinName?: string;\n changeSetId?: string;\n}\n\nexport function getRpcInterfaces(settings: Settings) {\n const rpcInterfaces = [];\n if (settings.runDevToolsRpcTests)\n rpcInterfaces.push(DevToolsRpcInterface);\n if (settings.runPresentationRpcTests)\n rpcInterfaces.push(PresentationRpcInterface);\n if (settings.runiModelReadRpcTests)\n rpcInterfaces.push(IModelReadRpcInterface);\n if (settings.runiModelTileRpcTests)\n rpcInterfaces.push(IModelTileRpcInterface);\n\n return rpcInterfaces;\n}\n\nfunction checkEnabled(envVariable: string | undefined): boolean {\n if (undefined === envVariable)\n return false;\n\n const regex = /true/i;\n return regex.test(envVariable);\n}\n\nexport class Settings {\n private _backend: Backend = {} as Backend;\n public env: number = 0;\n public oidcClientId!: string;\n public oidcScopes!: string;\n public oidcRedirect!: string;\n public oidcAuthority?: string;\n public gprid?: string;\n public logLevel?: number;\n public users: TestUserCredentials[] = [];\n public clientConfiguration?: ServiceAuthorizationClientConfiguration;\n\n public iModels: IModelData[] = [];\n public get iModel(): IModelData { return this.iModels[0]; }\n public get writeIModel(): IModelData { return this.iModels[1]; }\n public get user(): TestUserCredentials { return this.users[0]; }\n\n // eslint-disable-next-line @typescript-eslint/naming-convention\n public get Backend(): Backend { return this._backend; }\n\n public get runiModelTileRpcTests(): boolean { return checkEnabled(process.env.RPC_IMODELTILE_ENABLE); }\n public get runPresentationRpcTests(): boolean { return checkEnabled(process.env.RPC_PRESENTATION_ENABLE); }\n public get runiModelReadRpcTests(): boolean { return checkEnabled(process.env.RPC_IMODELREAD_ENABLE); }\n public get runiModelWriteRpcTests(): boolean { return checkEnabled(process.env.RPC_IMODELWRITE_ENABLE); }\n public get runDevToolsRpcTests(): boolean { return checkEnabled(process.env.RPC_DEVTOOLS_ENABLE); }\n\n constructor(env: NodeJS.ProcessEnv) {\n const isFrontend = (typeof (process) === \"undefined\");\n if (!isFrontend && undefined === env.TF_BUILD) {\n const path = require(\"path\"); // eslint-disable-line @typescript-eslint/no-require-imports\n const dotenv = require(\"dotenv\"); // eslint-disable-line @typescript-eslint/no-require-imports\n const dotenvExpand = require(\"dotenv-expand\"); // eslint-disable-line @typescript-eslint/no-require-imports\n // First check in process.cwd() for the config\n let result = dotenv.config();\n if (result.error) {\n const potential = path.resolve(process.cwd(), \"..\", \"..\", \"..\", \"imodeljs-config\", \".env\");\n result = dotenv.config({ path: potential });\n if (result.error)\n throw result.error;\n }\n\n dotenvExpand(result);\n }\n\n if (isFrontend)\n globalThis.process = { browser: true, env } as any;\n\n // Loads the config out of the environment.\n this.load();\n }\n\n /** Loads the necessary variables from `process.env`.\n */\n private load() {\n // Parse OIDC\n if (undefined === process.env.OIDC_CLIENT_ID)\n throw new Error(\"Missing the 'OIDC_CLIENT_ID' setting.\");\n this.oidcClientId = process.env.OIDC_CLIENT_ID!;\n\n if (undefined === process.env.OIDC_SCOPES)\n throw new Error(\"Missing the 'OIDC_SCOPES' setting\");\n this.oidcScopes = process.env.OIDC_SCOPES;\n\n if (process.env.OIDC_AUTHORITY)\n this.oidcAuthority = process.env.OIDC_AUTHORITY;\n\n this.oidcRedirect = (undefined === process.env.OIDC_REDIRECT) ? \"http://localhost:5000\" : process.env.OIDC_REDIRECT;\n\n // Parse GPRId\n if (undefined !== process.env.GPRID)\n this.gprid = process.env.GPRID;\n\n // Parse the iModel variables\n if (!process.env.IMODEL_PROJECTID && !process.env.IMODEL_PROJECTNAME)\n throw new Error(\"Missing the 'IMODEL_PROJECTID' or 'IMODEL_PROJECTNAME' setting.\");\n\n if (!process.env.IMODEL_IMODELID && !process.env.IMODEL_IMODELNAME)\n throw new Error(\"Missing the 'IMODEL_IMODELID' or 'IMODEL_IMODELNAME' setting.\");\n\n // Note: This is kind of messy but we don't sign-in to resolve the Names into IDs until the TestContext.\n this.iModels.push({\n useName: !process.env.IMODEL_IMODELID,\n id: process.env.IMODEL_IMODELID,\n name: process.env.IMODEL_IMODELNAME,\n useITwinName: !process.env.IMODEL_PROJECTID,\n iTwinId: process.env.IMODEL_PROJECTID,\n iTwinName: process.env.IMODEL_PROJECTNAME,\n\n // Neither of the next 2 are needed but since they'll be undefined anyway, just always set it.\n changeSetId: process.env.IMODEL_CHANGESETID,\n });\n\n // If write rpc interface is defined expect a separate iModel to be used.\n if (this.runiModelWriteRpcTests) {\n if (!process.env.IMODEL_WRITE_PROJECTID && !process.env.IMODEL_WRITE_PROJECTNAME)\n throw new Error(\"Missing the 'IMODEL_WRITE_PROJECTID' or 'IMODEL_WRITE_PROJECTNAME' setting.\");\n\n if (!process.env.IMODEL_WRITE_IMODELID && !process.env.IMODEL_WRITE_IMODELNAME)\n throw new Error(\"Missing the 'IMODEL_WRITE_IMODELID' or 'IMODEL_WRITE_IMODELNAME' setting.\");\n\n this.iModels.push({\n useName: !process.env.IMODEL_WRITE_IMODELID,\n id: process.env.IMODEL_WRITE_IMODELID,\n name: process.env.IMODEL_WRITE_IMODELNAME,\n useITwinName: !process.env.IMODEL_WRITE_PROJECTID,\n iTwinId: process.env.IMODEL_WRITE_PROJECTID,\n iTwinName: process.env.IMODEL_WRITE_PROJECTNAME,\n });\n }\n\n // Parse logging level\n if (undefined !== process.env.LOG_LEVEL) {\n const level = parseInt(process.env.LOG_LEVEL, 10);\n if (!isNaN(level) && undefined !== LogLevel[level])\n this.logLevel = level;\n }\n\n // Get backend data\n if (undefined === process.env.BACKEND_LOCATION)\n throw new Error(\"Missing the 'BACKEND_LOCATION' setting.\");\n this._backend.location = process.env.BACKEND_LOCATION;\n\n if (undefined === process.env.BACKEND_VERSION)\n throw new Error(\"Missing the 'BACKEND_VERSION' setting.\");\n this._backend.version = process.env.BACKEND_VERSION;\n\n if (undefined === process.env.BACKEND_NAME)\n throw new Error(\"Missing the 'BACKEND_NAME' setting.\");\n this._backend.name = process.env.BACKEND_NAME;\n\n // Get users\n this.users.push({\n email: process.env.USER_WITH_ACCESS_USERNAME || \"\",\n password: process.env.USER_WITH_ACCESS_PASSWORD || \"\",\n });\n\n if (undefined !== process.env.CLIENT_WITH_ACCESS_ID && undefined !== process.env.CLIENT_WITH_ACCESS_SECRET && undefined !== process.env.CLIENT_WITH_ACCESS_SCOPES) {\n this.clientConfiguration = {\n clientId: process.env.CLIENT_WITH_ACCESS_ID,\n clientSecret: process.env.CLIENT_WITH_ACCESS_SECRET,\n scope: process.env.CLIENT_WITH_ACCESS_SCOPES,\n authority: this.oidcAuthority,\n };\n }\n }\n\n public toString(): string {\n return `Configurations:\n backend location: ${this.Backend.location},\n backend name: ${this.Backend.name},\n backend version: ${this.Backend.version},\n oidc client id: ${this.oidcClientId},\n oidc scopes: ${this.oidcScopes},\n applicationId: ${this.gprid},\n log level: ${this.logLevel},\n testing iModelTileRpcTests: ${this.runiModelTileRpcTests},\n testing PresentationRpcTest: ${this.runPresentationRpcTests},\n testing iModelReadRpcTests: ${this.runiModelReadRpcTests},\n testing DevToolsRpcTests: ${this.runDevToolsRpcTests},\n testing iModelWriteRpcTests: ${this.runiModelWriteRpcTests}`;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SideChannels.js","sourceRoot":"","sources":["../../src/common/SideChannels.ts"],"names":[],"mappings":";;AAWA,wDAUC;AAED,4DAEC;AACD,0EAGC;AAvBD,wEAAuG;AAEvG,MAAM,kBAAkB,GAAG,QAAQ,CAAC;AACpC,MAAM,gCAAgC,GAAG,sBAAsB,CAAC;AAEhE,SAAgB,sBAAsB;IACpC,IAAA,uCAAuB,EAAC,kBAAkB,EAAE,GAAG,EAAE;QAC/C,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;IAEH,IAAA,uCAAuB,EAAC,gCAAgC,EAAE,KAAK,IAAI,EAAE;QACnE,0EAA0E;QAC1E,mDAAmD;QACnD,OAAO,EAAE,CAAC;IACZ,CAAC,CAAC,CAAC;AACL,CAAC;AAEM,KAAK,UAAU,wBAAwB;IAC5C,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,IAAA,sCAAsB,EAAC,kBAAkB,CAAC,CAAC,CAAC;AACtE,CAAC;AACM,KAAK,UAAU,+BAA+B;IACnD,2GAA2G;IAC3G,OAAO,EAAE,CAAC;AACZ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"SideChannels.js","sourceRoot":"","sources":["../../src/common/SideChannels.ts"],"names":[],"mappings":";;AAWA,wDAUC;AAED,4DAEC;AACD,0EAGC;AAvBD,wEAAuG;AAEvG,MAAM,kBAAkB,GAAG,QAAQ,CAAC;AACpC,MAAM,gCAAgC,GAAG,sBAAsB,CAAC;AAEhE,SAAgB,sBAAsB;IACpC,IAAA,uCAAuB,EAAC,kBAAkB,EAAE,GAAG,EAAE;QAC/C,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;IAEH,IAAA,uCAAuB,EAAC,gCAAgC,EAAE,KAAK,IAAI,EAAE;QACnE,0EAA0E;QAC1E,mDAAmD;QACnD,OAAO,EAAE,CAAC;IACZ,CAAC,CAAC,CAAC;AACL,CAAC;AAEM,KAAK,UAAU,wBAAwB;IAC5C,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,IAAA,sCAAsB,EAAC,kBAAkB,CAAC,CAAC,CAAC;AACtE,CAAC;AACM,KAAK,UAAU,+BAA+B;IACnD,2GAA2G;IAC3G,OAAO,EAAE,CAAC;AACZ,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// import { ServiceAuthorizationClient, ServiceAuthorizationClientConfiguration } from \"@itwin/service-authorization\";\nimport { AccessToken } from \"@itwin/core-bentley\";\nimport { executeBackendCallback, registerBackendCallback } from \"@itwin/certa/lib/utils/CallbackUtils\";\n\nconst getEnvCallbackName = \"getEnv\";\nconst getClientAccessTokenCallbackName = \"getClientAccessToken\";\n\nexport function exposeBackendCallbacks() {\n registerBackendCallback(getEnvCallbackName, () => {\n return JSON.stringify(process.env);\n });\n\n registerBackendCallback(getClientAccessTokenCallbackName, async () => {\n // const authClient = new ServiceAuthorizationClient(clientConfiguration);\n // const token = await authClient.getAccessToken();\n return \"\";\n });\n}\n\nexport async function getProcessEnvFromBackend(): Promise<NodeJS.ProcessEnv> {\n return JSON.parse(await executeBackendCallback(getEnvCallbackName));\n}\nexport async function getClientAccessTokenFromBackend(): Promise<AccessToken> {\n // const tokenString = await executeBackendCallback(getClientAccessTokenCallbackName, clientConfiguration);\n return \"\";\n}\n"]}
|
|
@@ -50713,6 +50713,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
50713
50713
|
/* harmony export */ ImageBufferFormat: () => (/* binding */ ImageBufferFormat),
|
|
50714
50714
|
/* harmony export */ ImageSource: () => (/* binding */ ImageSource),
|
|
50715
50715
|
/* harmony export */ ImageSourceFormat: () => (/* binding */ ImageSourceFormat),
|
|
50716
|
+
/* harmony export */ isBinaryImageSource: () => (/* binding */ isBinaryImageSource),
|
|
50716
50717
|
/* harmony export */ isPowerOfTwo: () => (/* binding */ isPowerOfTwo),
|
|
50717
50718
|
/* harmony export */ isValidImageSourceFormat: () => (/* binding */ isValidImageSourceFormat),
|
|
50718
50719
|
/* harmony export */ nextHighestPowerOfTwo: () => (/* binding */ nextHighestPowerOfTwo)
|
|
@@ -50846,6 +50847,12 @@ class ImageSource {
|
|
|
50846
50847
|
this.format = format;
|
|
50847
50848
|
}
|
|
50848
50849
|
}
|
|
50850
|
+
/** Returns true if `source` is a [[BinaryImageSource]].
|
|
50851
|
+
* @public
|
|
50852
|
+
*/
|
|
50853
|
+
function isBinaryImageSource(source) {
|
|
50854
|
+
return source.format !== ImageSourceFormat.Svg && source.data instanceof Uint8Array;
|
|
50855
|
+
}
|
|
50849
50856
|
|
|
50850
50857
|
|
|
50851
50858
|
/***/ }),
|
|
@@ -60091,6 +60098,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
60091
60098
|
/* harmony export */ iTwinChannel: () => (/* reexport safe */ _ipc_IpcSocket__WEBPACK_IMPORTED_MODULE_71__.iTwinChannel),
|
|
60092
60099
|
/* harmony export */ initializeRpcRequest: () => (/* reexport safe */ _rpc_core_RpcRequest__WEBPACK_IMPORTED_MODULE_129__.initializeRpcRequest),
|
|
60093
60100
|
/* harmony export */ ipcAppChannels: () => (/* reexport safe */ _IpcAppProps__WEBPACK_IMPORTED_MODULE_75__.ipcAppChannels),
|
|
60101
|
+
/* harmony export */ isBinaryImageSource: () => (/* reexport safe */ _Image__WEBPACK_IMPORTED_MODULE_66__.isBinaryImageSource),
|
|
60094
60102
|
/* harmony export */ isKnownTileFormat: () => (/* reexport safe */ _tile_TileIO__WEBPACK_IMPORTED_MODULE_154__.isKnownTileFormat),
|
|
60095
60103
|
/* harmony export */ isPlacement2dProps: () => (/* reexport safe */ _ElementProps__WEBPACK_IMPORTED_MODULE_29__.isPlacement2dProps),
|
|
60096
60104
|
/* harmony export */ isPlacement3dProps: () => (/* reexport safe */ _ElementProps__WEBPACK_IMPORTED_MODULE_29__.isPlacement3dProps),
|
|
@@ -70671,7 +70679,7 @@ class IModelReadRpcInterface extends _RpcInterface__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
70671
70679
|
async cancelSnap(_iModelToken, _sessionId) { return this.forward(arguments); }
|
|
70672
70680
|
async getGeometryContainment(_iModelToken, _props) { return this.forward(arguments); }
|
|
70673
70681
|
async getMassProperties(_iModelToken, _props) { return this.forward(arguments); }
|
|
70674
|
-
async getMassPropertiesPerCandidate(_iModelToken, _props) { return this.forward(arguments); }
|
|
70682
|
+
async getMassPropertiesPerCandidate(_iModelToken, _props) { return this.forward(arguments); } // eslint-disable-line @typescript-eslint/no-deprecated
|
|
70675
70683
|
async getIModelCoordinatesFromGeoCoordinates(_iModelToken, _props) { return this.forward(arguments); }
|
|
70676
70684
|
async getGeoCoordinatesFromIModelCoordinates(_iModelToken, _props) { return this.forward(arguments); }
|
|
70677
70685
|
async getGeometrySummary(_iModelToken, _props) { return this.forward(arguments); }
|
|
@@ -88398,11 +88406,18 @@ class AccuDraw {
|
|
|
88398
88406
|
inVec.crossProduct(yVec, normalVec);
|
|
88399
88407
|
return true;
|
|
88400
88408
|
}
|
|
88409
|
+
_acosWithLimitCheck(value) {
|
|
88410
|
+
if (value >= 1.0)
|
|
88411
|
+
return 0.0;
|
|
88412
|
+
if (value <= -1.0)
|
|
88413
|
+
return Math.PI;
|
|
88414
|
+
return Math.acos(value);
|
|
88415
|
+
}
|
|
88401
88416
|
handleDegeneratePolarCase() {
|
|
88402
88417
|
if (!(this.locked & LockedStates.DIST_BM))
|
|
88403
88418
|
this._distance = 0.0;
|
|
88404
88419
|
if (this.locked & LockedStates.VEC_BM) {
|
|
88405
|
-
this._angle =
|
|
88420
|
+
this._angle = this._acosWithLimitCheck(this.vector.dotProduct(this.axes.x));
|
|
88406
88421
|
}
|
|
88407
88422
|
else if (this.locked & LockedStates.Y_BM) {
|
|
88408
88423
|
this.vector.setFrom(this.axes.y);
|
|
@@ -88416,7 +88431,7 @@ class AccuDraw {
|
|
|
88416
88431
|
}
|
|
88417
88432
|
else {
|
|
88418
88433
|
// use last good vector
|
|
88419
|
-
this._angle =
|
|
88434
|
+
this._angle = this._acosWithLimitCheck(this.vector.dotProduct(this.axes.x));
|
|
88420
88435
|
}
|
|
88421
88436
|
this.origin.plusScaled(this.vector, this._distance, this.point);
|
|
88422
88437
|
}
|
|
@@ -99286,13 +99301,13 @@ class IModelConnection extends _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.I
|
|
|
99286
99301
|
}
|
|
99287
99302
|
return undefined;
|
|
99288
99303
|
}
|
|
99289
|
-
/** Request element mass properties from the backend.
|
|
99290
|
-
* @note For better performance use [[getMassPropertiesPerCandidate]] when called from a loop with identical operations and a single candidate per iteration.
|
|
99291
|
-
*/
|
|
99304
|
+
/** Request element mass properties from the backend. */
|
|
99292
99305
|
async getMassProperties(requestProps) {
|
|
99293
99306
|
return _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.IModelReadRpcInterface.getClientForRouting(this.routingContext.token).getMassProperties(this.getRpcProps(), requestProps);
|
|
99294
99307
|
}
|
|
99295
|
-
/** Request mass properties for multiple elements from the backend.
|
|
99308
|
+
/** Request mass properties for multiple elements from the backend.
|
|
99309
|
+
* @deprecated in 4.11. Use [[IModelConnection.getMassProperties]].
|
|
99310
|
+
*/
|
|
99296
99311
|
async getMassPropertiesPerCandidate(requestProps) {
|
|
99297
99312
|
return _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.IModelReadRpcInterface.getClientForRouting(this.routingContext.token).getMassPropertiesPerCandidate(this.getRpcProps(), requestProps);
|
|
99298
99313
|
}
|
|
@@ -237318,7 +237333,7 @@ class Matrix3d {
|
|
|
237318
237333
|
let upVector = vectorA.unitCrossProduct(vectorB);
|
|
237319
237334
|
// the usual case (both vectors and also their cross product is non-zero)
|
|
237320
237335
|
if (upVector) {
|
|
237321
|
-
return Matrix3d.createRotationAroundVector(upVector, _Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createRadians(fraction * vectorA.planarAngleTo(vectorB, upVector).radians));
|
|
237336
|
+
return Matrix3d.createRotationAroundVector(upVector, _Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createRadians(fraction * vectorA.planarAngleTo(vectorB, upVector).radians), result);
|
|
237322
237337
|
}
|
|
237323
237338
|
// if either vector is zero
|
|
237324
237339
|
if (_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSmallMetricDistance(vectorA.magnitude())
|
|
@@ -237329,7 +237344,7 @@ class Matrix3d {
|
|
|
237329
237344
|
return Matrix3d.createIdentity(result);
|
|
237330
237345
|
// opposing vectors (cross product = 0, dot product < 0)
|
|
237331
237346
|
upVector = Matrix3d.createPerpendicularVectorFavorPlaneContainingZ(vectorA, upVector);
|
|
237332
|
-
return Matrix3d.createRotationAroundVector(upVector, _Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createRadians(fraction * Math.PI));
|
|
237347
|
+
return Matrix3d.createRotationAroundVector(upVector, _Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createRadians(fraction * Math.PI), result);
|
|
237333
237348
|
}
|
|
237334
237349
|
/** Returns a matrix that rotates from vectorA to vectorB. */
|
|
237335
237350
|
static createRotationVectorToVector(vectorA, vectorB, result) {
|
|
@@ -312062,7 +312077,7 @@ class ParserSpec {
|
|
|
312062
312077
|
* async calls to lookup unit definitions.
|
|
312063
312078
|
* @param format The format specification.
|
|
312064
312079
|
* @param unitsProvider The units provider is used to look up unit definitions and provide conversion information for converting between units.
|
|
312065
|
-
* @param outUnit The unit
|
|
312080
|
+
* @param outUnit The unit a value will be formatted to. This unit is often referred to as persistence unit.
|
|
312066
312081
|
*/
|
|
312067
312082
|
static async create(format, unitsProvider, outUnit, altUnitLabelsProvider) {
|
|
312068
312083
|
const conversions = await _Parser__WEBPACK_IMPORTED_MODULE_0__.Parser.createUnitConversionSpecsForUnit(unitsProvider, outUnit, altUnitLabelsProvider);
|
|
@@ -313023,18 +313038,18 @@ class Settings {
|
|
|
313023
313038
|
}
|
|
313024
313039
|
}
|
|
313025
313040
|
toString() {
|
|
313026
|
-
return `Configurations:
|
|
313027
|
-
backend location: ${this.Backend.location},
|
|
313028
|
-
backend name: ${this.Backend.name},
|
|
313029
|
-
backend version: ${this.Backend.version},
|
|
313030
|
-
oidc client id: ${this.oidcClientId},
|
|
313031
|
-
oidc scopes: ${this.oidcScopes},
|
|
313032
|
-
applicationId: ${this.gprid},
|
|
313033
|
-
log level: ${this.logLevel},
|
|
313034
|
-
testing iModelTileRpcTests: ${this.runiModelTileRpcTests},
|
|
313035
|
-
testing PresentationRpcTest: ${this.runPresentationRpcTests},
|
|
313036
|
-
testing iModelReadRpcTests: ${this.runiModelReadRpcTests},
|
|
313037
|
-
testing DevToolsRpcTests: ${this.runDevToolsRpcTests},
|
|
313041
|
+
return `Configurations:
|
|
313042
|
+
backend location: ${this.Backend.location},
|
|
313043
|
+
backend name: ${this.Backend.name},
|
|
313044
|
+
backend version: ${this.Backend.version},
|
|
313045
|
+
oidc client id: ${this.oidcClientId},
|
|
313046
|
+
oidc scopes: ${this.oidcScopes},
|
|
313047
|
+
applicationId: ${this.gprid},
|
|
313048
|
+
log level: ${this.logLevel},
|
|
313049
|
+
testing iModelTileRpcTests: ${this.runiModelTileRpcTests},
|
|
313050
|
+
testing PresentationRpcTest: ${this.runPresentationRpcTests},
|
|
313051
|
+
testing iModelReadRpcTests: ${this.runiModelReadRpcTests},
|
|
313052
|
+
testing DevToolsRpcTests: ${this.runDevToolsRpcTests},
|
|
313038
313053
|
testing iModelWriteRpcTests: ${this.runiModelWriteRpcTests}`;
|
|
313039
313054
|
}
|
|
313040
313055
|
}
|
|
@@ -313248,7 +313263,7 @@ class TestContext {
|
|
|
313248
313263
|
this.initializeRpcInterfaces({ title: this.settings.Backend.name, version: this.settings.Backend.version });
|
|
313249
313264
|
const iModelClient = new imodels_client_management_1.IModelsClient({ api: { baseUrl: `https://${process.env.IMJS_URL_PREFIX ?? ""}api.bentley.com/imodels` } });
|
|
313250
313265
|
await core_frontend_1.NoRenderApp.startup({
|
|
313251
|
-
applicationVersion: "5.0.0-dev.
|
|
313266
|
+
applicationVersion: "5.0.0-dev.67",
|
|
313252
313267
|
applicationId: this.settings.gprid,
|
|
313253
313268
|
authorizationClient: new frontend_1.TestFrontendAuthorizationClient(this.serviceAuthToken),
|
|
313254
313269
|
hubAccess: new imodels_access_frontend_1.FrontendIModelsAccess(iModelClient),
|
|
@@ -313339,6 +313354,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
313339
313354
|
/* harmony export */ combineDiagnosticsSeverities: () => (/* reexport safe */ _presentation_common_Diagnostics__WEBPACK_IMPORTED_MODULE_1__.combineDiagnosticsSeverities),
|
|
313340
313355
|
/* harmony export */ combineFieldNames: () => (/* reexport safe */ _presentation_common_content_ContentTraverser__WEBPACK_IMPORTED_MODULE_30__.combineFieldNames),
|
|
313341
313356
|
/* harmony export */ compareDiagnosticsSeverities: () => (/* reexport safe */ _presentation_common_Diagnostics__WEBPACK_IMPORTED_MODULE_1__.compareDiagnosticsSeverities),
|
|
313357
|
+
/* harmony export */ createCancellableTimeoutPromise: () => (/* reexport safe */ _presentation_common_Utils__WEBPACK_IMPORTED_MODULE_11__.createCancellableTimeoutPromise),
|
|
313342
313358
|
/* harmony export */ createFieldHierarchies: () => (/* reexport safe */ _presentation_common_content_ContentTraverser__WEBPACK_IMPORTED_MODULE_30__.createFieldHierarchies),
|
|
313343
313359
|
/* harmony export */ deepReplaceNullsToUndefined: () => (/* reexport safe */ _presentation_common_Utils__WEBPACK_IMPORTED_MODULE_11__.deepReplaceNullsToUndefined),
|
|
313344
313360
|
/* harmony export */ getFieldByDescriptor: () => (/* reexport safe */ _presentation_common_content_Fields__WEBPACK_IMPORTED_MODULE_24__.getFieldByDescriptor),
|
|
@@ -314197,6 +314213,8 @@ var PresentationStatus;
|
|
|
314197
314213
|
/**
|
|
314198
314214
|
* Timeout for the request was reached which prevented it from being fulfilled. Frontend may
|
|
314199
314215
|
* repeat the request.
|
|
314216
|
+
*
|
|
314217
|
+
* @deprecated in 5.x. Presentation RPC now relies on `RpcPendingResponse` to handle timeouts.
|
|
314200
314218
|
*/
|
|
314201
314219
|
PresentationStatus[PresentationStatus["BackendTimeout"] = 65543] = "BackendTimeout";
|
|
314202
314220
|
})(PresentationStatus || (PresentationStatus = {}));
|
|
@@ -315207,6 +315225,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
315207
315225
|
/** @packageDocumentation
|
|
315208
315226
|
* @module RPC
|
|
315209
315227
|
*/
|
|
315228
|
+
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
315229
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
315230
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
315231
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
315232
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
315233
|
+
};
|
|
315210
315234
|
|
|
315211
315235
|
|
|
315212
315236
|
|
|
@@ -315214,11 +315238,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
315214
315238
|
* Interface used for communication between Presentation backend and frontend.
|
|
315215
315239
|
* @public
|
|
315216
315240
|
*/
|
|
315217
|
-
class PresentationRpcInterface extends _itwin_core_common__WEBPACK_IMPORTED_MODULE_0__.RpcInterface {
|
|
315241
|
+
let PresentationRpcInterface = class PresentationRpcInterface extends _itwin_core_common__WEBPACK_IMPORTED_MODULE_0__.RpcInterface {
|
|
315218
315242
|
/** The immutable name of the interface. */
|
|
315219
315243
|
static interfaceName = "PresentationRpcInterface";
|
|
315220
315244
|
/** The semantic version of the interface. */
|
|
315221
|
-
static interfaceVersion = "
|
|
315245
|
+
static interfaceVersion = "5.0.0";
|
|
315222
315246
|
/*===========================================================================================
|
|
315223
315247
|
NOTE: Any add/remove/change to the methods below requires an update of the interface version.
|
|
315224
315248
|
NOTE: Please consult the README in core/common/src/rpc for the semantic versioning rules.
|
|
@@ -315306,7 +315330,11 @@ class PresentationRpcInterface extends _itwin_core_common__WEBPACK_IMPORTED_MODU
|
|
|
315306
315330
|
async computeSelection(_token, _options) {
|
|
315307
315331
|
return this.forward(arguments);
|
|
315308
315332
|
}
|
|
315309
|
-
}
|
|
315333
|
+
};
|
|
315334
|
+
PresentationRpcInterface = __decorate([
|
|
315335
|
+
_itwin_core_common__WEBPACK_IMPORTED_MODULE_0__.RpcOperation.setDefaultPolicy({ retryInterval: () => 0 })
|
|
315336
|
+
], PresentationRpcInterface);
|
|
315337
|
+
|
|
315310
315338
|
/** @internal */
|
|
315311
315339
|
var PresentationIpcEvents;
|
|
315312
315340
|
(function (PresentationIpcEvents) {
|
|
@@ -315399,6 +315427,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
315399
315427
|
/* harmony import */ var _CommonLoggerCategory__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./CommonLoggerCategory */ "../../presentation/common/lib/esm/presentation-common/CommonLoggerCategory.js");
|
|
315400
315428
|
/* harmony import */ var _Error__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Error */ "../../presentation/common/lib/esm/presentation-common/Error.js");
|
|
315401
315429
|
/* harmony import */ var _PresentationRpcInterface__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./PresentationRpcInterface */ "../../presentation/common/lib/esm/presentation-common/PresentationRpcInterface.js");
|
|
315430
|
+
/* harmony import */ var _Utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Utils */ "../../presentation/common/lib/esm/presentation-common/Utils.js");
|
|
315402
315431
|
/*---------------------------------------------------------------------------------------------
|
|
315403
315432
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
315404
315433
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -315411,6 +315440,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
315411
315440
|
|
|
315412
315441
|
|
|
315413
315442
|
|
|
315443
|
+
|
|
315414
315444
|
/**
|
|
315415
315445
|
* Default timeout for how long we're going to wait for RPC request to be fulfilled before throwing
|
|
315416
315446
|
* a timeout error.
|
|
@@ -315437,34 +315467,37 @@ class RpcRequestsHandler {
|
|
|
315437
315467
|
return _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.RpcManager.getClientForInterface(_PresentationRpcInterface__WEBPACK_IMPORTED_MODULE_4__.PresentationRpcInterface);
|
|
315438
315468
|
}
|
|
315439
315469
|
async requestWithTimeout(func, diagnosticsHandler) {
|
|
315440
|
-
const
|
|
315441
|
-
const
|
|
315442
|
-
|
|
315443
|
-
|
|
315444
|
-
|
|
315445
|
-
|
|
315446
|
-
|
|
315447
|
-
|
|
315448
|
-
|
|
315449
|
-
|
|
315450
|
-
|
|
315451
|
-
|
|
315452
|
-
|
|
315453
|
-
|
|
315470
|
+
const rpcResponsePromise = func();
|
|
315471
|
+
const rpcRequest = _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.RpcRequest.current(this.rpcClient);
|
|
315472
|
+
const timeout = (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.createCancellableTimeoutPromise)(this.timeout);
|
|
315473
|
+
return Promise.race([
|
|
315474
|
+
(async () => {
|
|
315475
|
+
let diagnostics;
|
|
315476
|
+
try {
|
|
315477
|
+
const response = await rpcResponsePromise;
|
|
315478
|
+
diagnostics = response.diagnostics;
|
|
315479
|
+
switch (response.statusCode) {
|
|
315480
|
+
case _Error__WEBPACK_IMPORTED_MODULE_3__.PresentationStatus.Success:
|
|
315481
|
+
return response.result;
|
|
315482
|
+
default:
|
|
315483
|
+
throw new _Error__WEBPACK_IMPORTED_MODULE_3__.PresentationError(response.statusCode, response.errorMessage);
|
|
315484
|
+
}
|
|
315454
315485
|
}
|
|
315455
|
-
|
|
315456
|
-
|
|
315457
|
-
|
|
315458
|
-
}
|
|
315459
|
-
|
|
315460
|
-
|
|
315486
|
+
finally {
|
|
315487
|
+
diagnosticsHandler && diagnostics && diagnosticsHandler(diagnostics);
|
|
315488
|
+
}
|
|
315489
|
+
})(),
|
|
315490
|
+
timeout.promise.then(() => {
|
|
315491
|
+
throw new Error(`Processing the request took longer than the configured limit of ${this.timeout} ms`);
|
|
315492
|
+
}),
|
|
315493
|
+
]).finally(() => {
|
|
315494
|
+
rpcRequest?.cancel();
|
|
315495
|
+
timeout.cancel();
|
|
315496
|
+
});
|
|
315461
315497
|
}
|
|
315462
315498
|
/**
|
|
315463
|
-
* Send the request to backend.
|
|
315464
|
-
*
|
|
315465
|
-
* If the backend responds with [[PresentationStatus.BackendTimeout]], the request is repeated until we hit `timeout` or get
|
|
315466
|
-
* a response. If the response is other than [[PresentationStatus.BackendTimeout]] or [[PresentationStatus.Success]], a [[PresentationError]]
|
|
315467
|
-
* is thrown with the details from the response.
|
|
315499
|
+
* Send the request to backend. We'll wait for the response for `this.timeout` ms, and if we don't get the response by
|
|
315500
|
+
* then, we'll throw an error.
|
|
315468
315501
|
*/
|
|
315469
315502
|
async request(func, options, ...additionalOptions) {
|
|
315470
315503
|
const { imodel, diagnostics, ...optionsNoIModel } = options;
|
|
@@ -315945,6 +315978,7 @@ const UPDATE_FULL = "FULL";
|
|
|
315945
315978
|
__webpack_require__.r(__webpack_exports__);
|
|
315946
315979
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
315947
315980
|
/* harmony export */ DEFAULT_KEYS_BATCH_SIZE: () => (/* binding */ DEFAULT_KEYS_BATCH_SIZE),
|
|
315981
|
+
/* harmony export */ createCancellableTimeoutPromise: () => (/* binding */ createCancellableTimeoutPromise),
|
|
315948
315982
|
/* harmony export */ deepReplaceNullsToUndefined: () => (/* binding */ deepReplaceNullsToUndefined),
|
|
315949
315983
|
/* harmony export */ getInstancesCount: () => (/* binding */ getInstancesCount),
|
|
315950
315984
|
/* harmony export */ omitUndefined: () => (/* binding */ omitUndefined)
|
|
@@ -316027,6 +316061,22 @@ function deepReplaceNullsToUndefined(obj) {
|
|
|
316027
316061
|
}
|
|
316028
316062
|
return obj;
|
|
316029
316063
|
}
|
|
316064
|
+
/** @internal */
|
|
316065
|
+
function createCancellableTimeoutPromise(timeoutMs) {
|
|
316066
|
+
let timeout;
|
|
316067
|
+
let rejectPromise;
|
|
316068
|
+
const promise = new Promise((resolve, reject) => {
|
|
316069
|
+
rejectPromise = reject;
|
|
316070
|
+
timeout = setTimeout(resolve, timeoutMs);
|
|
316071
|
+
});
|
|
316072
|
+
return {
|
|
316073
|
+
promise,
|
|
316074
|
+
cancel: () => {
|
|
316075
|
+
clearTimeout(timeout);
|
|
316076
|
+
rejectPromise();
|
|
316077
|
+
},
|
|
316078
|
+
};
|
|
316079
|
+
}
|
|
316030
316080
|
|
|
316031
316081
|
|
|
316032
316082
|
/***/ }),
|
|
@@ -339301,7 +339351,7 @@ function __rewriteRelativeImportExtension(path, preserveJsx) {
|
|
|
339301
339351
|
/***/ ((module) => {
|
|
339302
339352
|
|
|
339303
339353
|
"use strict";
|
|
339304
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.0.0-dev.
|
|
339354
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.0.0-dev.67","description":"iTwin.js frontend components","main":"lib/cjs/core-frontend.js","module":"lib/esm/core-frontend.js","typings":"lib/cjs/core-frontend","license":"MIT","scripts":{"build":"npm run -s copy:public && npm run -s build:cjs && npm run -s build:esm && npm run -s webpackWorkers && npm run -s copy:workers","build:cjs":"npm run -s copy:js:cjs && tsc 1>&2 --outDir lib/cjs","build:esm":"npm run -s copy:js:esm && tsc 1>&2 --module ES2022 --outDir lib/esm","clean":"rimraf lib .rush/temp/package-deps*.json","copy:public":"cpx \\"./src/public/**/*\\" ./lib/public","copy:js:cjs":"cpx \\"./src/**/*.js\\" ./lib/cjs","copy:js:esm":"cpx \\"./src/**/*.js\\" ./lib/esm","copy:workers":"cpx \\"./lib/workers/webpack/parse-imdl-worker.js\\" ./lib/public/scripts","docs":"betools docs --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/map/*.d.ts,**/tile/*.d.ts,**/*-css.ts","extract-api":"betools extract-api --entry=core-frontend && npm run extract-extension-api","extract-extension-api":"eslint --no-inline-config -c extraction.eslint.config.js \\"./src/**/*.ts\\" 1>&2","lint":"eslint \\"./src/**/*.ts\\" 1>&2","lint-fix":"eslint --fix -f visualstudio \\"./src/**/*.ts\\" 1>&2","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run webpackTestWorker && vitest --run","cover":"npm run webpackTestWorker && vitest --run","test:debug":"vitest --run","webpackTests":"webpack --config ./src/test/utils/webpack.config.js 1>&2 && npm run -s webpackTestWorker","webpackTestWorker":"webpack --config ./src/test/worker/webpack.config.js 1>&2 && cpx \\"./lib/test/test-worker.js\\" ./lib/test","webpackWorkers":"webpack --config ./src/workers/ImdlParser/webpack.config.js 1>&2"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core.git","directory":"core/frontend"},"keywords":["Bentley","BIM","iModel","digital-twin","iTwin"],"author":{"name":"Bentley Systems, Inc.","url":"http://www.bentley.com"},"peerDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*"},"//devDependencies":["NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install","NOTE: All tools used by scripts in this package must be listed as devDependencies"],"devDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/build-tools":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/eslint-plugin":"5.0.0-dev.1","@types/chai-as-promised":"^7","@vitest/browser":"^3.0.5","@vitest/coverage-v8":"^3.0.5","cpx2":"^3.0.0","eslint":"^9.13.0","glob":"^10.3.12","playwright":"~1.47.1","rimraf":"^3.0.2","source-map-loader":"^4.0.0","typescript":"~5.6.2","typemoq":"^2.1.0","vitest":"^3.0.5","vite-multiple-assets":"^1.3.1","vite-plugin-static-copy":"1.0.6","webpack":"^5.97.1"},"//dependencies":["NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API","NOTE: core-frontend should remain UI technology agnostic, so no react/angular dependencies are allowed"],"dependencies":{"@itwin/cloud-agnostic-core":"^2.2.4","@itwin/object-storage-core":"^2.2.5","@itwin/core-i18n":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","fuse.js":"^3.3.0","wms-capabilities":"0.4.0"}}');
|
|
339305
339355
|
|
|
339306
339356
|
/***/ }),
|
|
339307
339357
|
|