@itwin/rpcinterface-full-stack-tests 5.3.0-dev.3 → 5.3.0-dev.5
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 +80 -54
- package/lib/dist/bundled-tests.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 +14 -14
|
@@ -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":["/*---------------------------------------------------------------------------------------------\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"]}
|
|
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":["/*---------------------------------------------------------------------------------------------\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 \"@itwin/oidc-signin-tool/lib/cjs/certa/certaBackend\";\r\n// Sets up certa to allow a method on the frontend to get an access token\r\nimport * as path from \"path\";\r\nimport { exposeBackendCallbacks } from \"../common/SideChannels\";\r\nimport * as fs from \"fs\";\r\n\r\n/** Loads the provided `.env` file into process.env */\r\nfunction loadEnv(envFile: string) {\r\n if (!fs.existsSync(envFile))\r\n return;\r\n\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 const envResult = dotenv.config({ path: envFile });\r\n if (envResult.error) {\r\n throw envResult.error;\r\n }\r\n\r\n dotenvExpand(envResult);\r\n}\r\n\r\nmodule.exports = (async () => {\r\n loadEnv(path.join(__dirname, \"..\", \"..\", \".env\"));\r\n\r\n exposeBackendCallbacks();\r\n})();\r\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;AAE1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;SACtD,CAAC,CAAC;QAEH,IAAI,SAAS,KAAK,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,SAAS,KAAK,OAAO,CAAC,GAAG,CAAC,yBAAyB,IAAI,SAAS,KAAK,OAAO,CAAC,GAAG,CAAC,yBAAyB,EAAE,CAAC;YAClK,IAAI,CAAC,mBAAmB,GAAG;gBACzB,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,qBAAqB;gBAC3C,YAAY,EAAE,OAAO,CAAC,GAAG,CAAC,yBAAyB;gBACnD,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,yBAAyB;gBAC5C,SAAS,EAAE,IAAI,CAAC,aAAa;aAC9B,CAAC;QACJ,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
|
+
{"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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yBAAyB;gBACnD,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,yBAAyB;gBAC5C,SAAS,EAAE,IAAI,CAAC,aAAa;aAC9B,CAAC;QACJ,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":["/*---------------------------------------------------------------------------------------------\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 +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":["/*---------------------------------------------------------------------------------------------\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"]}
|
|
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":["/*---------------------------------------------------------------------------------------------\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// import { ServiceAuthorizationClient, ServiceAuthorizationClientConfiguration } from \"@itwin/service-authorization\";\r\nimport { AccessToken } from \"@itwin/core-bentley\";\r\nimport { executeBackendCallback, registerBackendCallback } from \"@itwin/certa/lib/utils/CallbackUtils\";\r\n\r\nconst getEnvCallbackName = \"getEnv\";\r\nconst getClientAccessTokenCallbackName = \"getClientAccessToken\";\r\n\r\nexport function exposeBackendCallbacks() {\r\n registerBackendCallback(getEnvCallbackName, () => {\r\n return JSON.stringify(process.env);\r\n });\r\n\r\n registerBackendCallback(getClientAccessTokenCallbackName, async () => {\r\n // const authClient = new ServiceAuthorizationClient(clientConfiguration);\r\n // const token = await authClient.getAccessToken();\r\n return \"\";\r\n });\r\n}\r\n\r\nexport async function getProcessEnvFromBackend(): Promise<NodeJS.ProcessEnv> {\r\n return JSON.parse(await executeBackendCallback(getEnvCallbackName));\r\n}\r\nexport async function getClientAccessTokenFromBackend(): Promise<AccessToken> {\r\n // const tokenString = await executeBackendCallback(getClientAccessTokenCallbackName, clientConfiguration);\r\n return \"\";\r\n}\r\n"]}
|
|
@@ -185298,10 +185298,14 @@ class StandardQuantityTypeDefinition {
|
|
|
185298
185298
|
*/
|
|
185299
185299
|
class QuantityTypeFormatsProvider {
|
|
185300
185300
|
onFormatsChanged = new _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BeEvent();
|
|
185301
|
+
_removeListeners = [];
|
|
185301
185302
|
constructor() {
|
|
185302
|
-
_IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.quantityFormatter.onActiveFormattingUnitSystemChanged.addListener(() => {
|
|
185303
|
+
this._removeListeners.push(_IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.quantityFormatter.onActiveFormattingUnitSystemChanged.addListener(() => {
|
|
185303
185304
|
this.onFormatsChanged.raiseEvent({ formatsChanged: "all" });
|
|
185304
|
-
});
|
|
185305
|
+
}));
|
|
185306
|
+
}
|
|
185307
|
+
[Symbol.dispose]() {
|
|
185308
|
+
this._removeListeners.forEach(listener => listener());
|
|
185305
185309
|
}
|
|
185306
185310
|
_kindOfQuantityMap = new Map([
|
|
185307
185311
|
["AecUnits.LENGTH", QuantityType.Length],
|
|
@@ -334943,8 +334947,8 @@ class Formatter {
|
|
|
334943
334947
|
*/
|
|
334944
334948
|
static formatComposite(magnitude, spec) {
|
|
334945
334949
|
const compositeStrings = [];
|
|
334946
|
-
|
|
334947
|
-
let
|
|
334950
|
+
let isNegative = false;
|
|
334951
|
+
let remainingMagnitude = magnitude;
|
|
334948
334952
|
for (let i = 0; i < spec.unitConversions.length; i++) {
|
|
334949
334953
|
const currentLabel = spec.unitConversions[i].label;
|
|
334950
334954
|
const unitConversion = spec.unitConversions[i].conversion;
|
|
@@ -334954,40 +334958,43 @@ class Formatter {
|
|
|
334954
334958
|
throw new _Exception__WEBPACK_IMPORTED_MODULE_1__.QuantityError(_Exception__WEBPACK_IMPORTED_MODULE_1__.QuantityStatus.InvalidCompositeFormat, `The Format ${spec.format.name} has a invalid unit specification.`);
|
|
334955
334959
|
let unitValue = 0.0;
|
|
334956
334960
|
if (spec.format.type === _FormatEnums__WEBPACK_IMPORTED_MODULE_2__.FormatType.Ratio) {
|
|
334957
|
-
if (1 !== spec.format.units
|
|
334961
|
+
if (1 !== (spec.format.units?.length ?? 0))
|
|
334958
334962
|
throw new _Exception__WEBPACK_IMPORTED_MODULE_1__.QuantityError(_Exception__WEBPACK_IMPORTED_MODULE_1__.QuantityStatus.InvalidCompositeFormat, `The Format '${spec.format.name}' with type 'ratio' must have exactly one unit.`);
|
|
334959
334963
|
try {
|
|
334960
|
-
unitValue = (0,_Quantity__WEBPACK_IMPORTED_MODULE_3__.applyConversion)(
|
|
334964
|
+
unitValue = (0,_Quantity__WEBPACK_IMPORTED_MODULE_3__.applyConversion)(remainingMagnitude, unitConversion) + this.FPV_MINTHRESHOLD;
|
|
334961
334965
|
}
|
|
334962
334966
|
catch (e) {
|
|
334963
334967
|
// The "InvertingZero" error is thrown when the value is zero and the conversion factor is inverted.
|
|
334964
334968
|
// For ratio, we actually want to support this corner case and return "1:0" as the formatted value.
|
|
334965
334969
|
if (e instanceof _Exception__WEBPACK_IMPORTED_MODULE_1__.QuantityError && e.errorNumber === _Exception__WEBPACK_IMPORTED_MODULE_1__.QuantityStatus.InvertingZero) {
|
|
334966
|
-
return "1:0";
|
|
334970
|
+
return { componentText: "1:0", isNegative: false };
|
|
334967
334971
|
}
|
|
334968
334972
|
}
|
|
334969
334973
|
compositeStrings.push(this.formatRatio(unitValue, spec));
|
|
334974
|
+
isNegative = unitValue < 0;
|
|
334970
334975
|
continue;
|
|
334971
334976
|
}
|
|
334972
|
-
unitValue = (0,_Quantity__WEBPACK_IMPORTED_MODULE_3__.applyConversion)(
|
|
334977
|
+
unitValue = (0,_Quantity__WEBPACK_IMPORTED_MODULE_3__.applyConversion)(remainingMagnitude, unitConversion) + this.FPV_MINTHRESHOLD;
|
|
334973
334978
|
if (0 === i) {
|
|
334979
|
+
// Only set isNegative from the first (major) unit conversion
|
|
334980
|
+
isNegative = unitValue < 0;
|
|
334974
334981
|
const precisionScale = Math.pow(10, 8); // use a fixed round off precision of 8 to avoid loss of precision in actual magnitude
|
|
334975
334982
|
unitValue = Math.floor(unitValue * precisionScale + FPV_ROUNDFACTOR) / precisionScale;
|
|
334976
334983
|
if ((Math.abs(unitValue) < 0.0001) && spec.format.hasFormatTraitSet(_FormatEnums__WEBPACK_IMPORTED_MODULE_2__.FormatTraits.ZeroEmpty))
|
|
334977
|
-
return "";
|
|
334984
|
+
return { componentText: "", isNegative: false };
|
|
334978
334985
|
}
|
|
334979
|
-
if (i < spec.format.units
|
|
334980
|
-
const wholePart = Math.
|
|
334981
|
-
const componentText = Formatter.formatCompositePart(wholePart, false, currentLabel, spec);
|
|
334982
|
-
|
|
334986
|
+
if (i < (spec.format.units?.length ?? 0) - 1) {
|
|
334987
|
+
const wholePart = Math.trunc(unitValue);
|
|
334988
|
+
const componentText = Formatter.formatCompositePart(Math.abs(wholePart), false, currentLabel, spec);
|
|
334989
|
+
remainingMagnitude = unitValue - wholePart;
|
|
334983
334990
|
compositeStrings.push(componentText);
|
|
334984
334991
|
}
|
|
334985
334992
|
else {
|
|
334986
|
-
const componentText = Formatter.formatCompositePart(unitValue, true, currentLabel, spec);
|
|
334993
|
+
const componentText = Formatter.formatCompositePart(Math.abs(unitValue), true, currentLabel, spec);
|
|
334987
334994
|
compositeStrings.push(componentText);
|
|
334988
334995
|
}
|
|
334989
334996
|
}
|
|
334990
|
-
return compositeStrings.join(spec.format.spacerOrDefault);
|
|
334997
|
+
return { componentText: compositeStrings.join(spec.format.spacerOrDefault), isNegative };
|
|
334991
334998
|
}
|
|
334992
334999
|
/** Format a quantity value into a single text string. Imitate how formatting done by server method NumericFormatSpec::FormatDouble.
|
|
334993
335000
|
* @param magnitude quantity value
|
|
@@ -335116,45 +335123,58 @@ class Formatter {
|
|
|
335116
335123
|
}
|
|
335117
335124
|
return value;
|
|
335118
335125
|
}
|
|
335119
|
-
/**
|
|
335120
|
-
* @param
|
|
335121
|
-
* @param
|
|
335126
|
+
/** Helper function to apply sign formatting based on showSignOption
|
|
335127
|
+
* @param isNegative whether the value should be treated as negative
|
|
335128
|
+
* @param showSignOption the sign display option
|
|
335129
|
+
* @param formatType the format type (to handle bearing/azimuth exceptions)
|
|
335130
|
+
* @returns object containing prefix and suffix strings
|
|
335122
335131
|
*/
|
|
335123
|
-
static
|
|
335124
|
-
const valueIsNegative = magnitude < 0.0;
|
|
335132
|
+
static applySignFormatting(isNegative, showSignOption, formatType) {
|
|
335125
335133
|
let prefix = "";
|
|
335126
335134
|
let suffix = "";
|
|
335127
|
-
|
|
335128
|
-
if (spec.format.type === _FormatEnums__WEBPACK_IMPORTED_MODULE_2__.FormatType.Bearing || spec.format.type === _FormatEnums__WEBPACK_IMPORTED_MODULE_2__.FormatType.Azimuth) {
|
|
335129
|
-
const result = this.processBearingAndAzimuth(magnitude, spec);
|
|
335130
|
-
magnitude = result.magnitude;
|
|
335131
|
-
prefix = result.prefix ?? "";
|
|
335132
|
-
suffix = result.suffix ?? "";
|
|
335133
|
-
}
|
|
335134
|
-
switch (spec.format.showSignOption) {
|
|
335135
|
+
switch (showSignOption) {
|
|
335135
335136
|
case _FormatEnums__WEBPACK_IMPORTED_MODULE_2__.ShowSignOption.NegativeParentheses:
|
|
335136
|
-
if (
|
|
335137
|
-
prefix
|
|
335138
|
-
suffix =
|
|
335137
|
+
if (isNegative) {
|
|
335138
|
+
prefix = "(";
|
|
335139
|
+
suffix = ")";
|
|
335139
335140
|
}
|
|
335140
335141
|
break;
|
|
335141
335142
|
case _FormatEnums__WEBPACK_IMPORTED_MODULE_2__.ShowSignOption.OnlyNegative:
|
|
335142
|
-
if (
|
|
335143
|
-
prefix
|
|
335143
|
+
if (isNegative && formatType !== _FormatEnums__WEBPACK_IMPORTED_MODULE_2__.FormatType.Bearing && formatType !== _FormatEnums__WEBPACK_IMPORTED_MODULE_2__.FormatType.Azimuth) {
|
|
335144
|
+
prefix = "-";
|
|
335145
|
+
}
|
|
335144
335146
|
break;
|
|
335145
335147
|
case _FormatEnums__WEBPACK_IMPORTED_MODULE_2__.ShowSignOption.SignAlways:
|
|
335146
|
-
|
|
335147
|
-
prefix += "-";
|
|
335148
|
-
else
|
|
335149
|
-
prefix += "+";
|
|
335148
|
+
prefix = isNegative ? "-" : "+";
|
|
335150
335149
|
break;
|
|
335151
335150
|
case _FormatEnums__WEBPACK_IMPORTED_MODULE_2__.ShowSignOption.NoSign:
|
|
335152
335151
|
default:
|
|
335153
335152
|
break;
|
|
335154
335153
|
}
|
|
335154
|
+
return { prefix, suffix };
|
|
335155
|
+
}
|
|
335156
|
+
/** Format a quantity value into a single text string based on the current format specification of this class.
|
|
335157
|
+
* @param magnitude defines the value to spec.format.
|
|
335158
|
+
* @param spec A FormatterSpec object the defines specification for the magnitude and unit conversions for the formatter.
|
|
335159
|
+
*/
|
|
335160
|
+
static formatQuantity(magnitude, spec) {
|
|
335161
|
+
let valueIsNegative = magnitude < 0.0;
|
|
335162
|
+
let prefix = "";
|
|
335163
|
+
let suffix = "";
|
|
335164
|
+
let formattedValue = "";
|
|
335165
|
+
// Handle bearing/azimuth special formatting
|
|
335166
|
+
if (spec.format.type === _FormatEnums__WEBPACK_IMPORTED_MODULE_2__.FormatType.Bearing || spec.format.type === _FormatEnums__WEBPACK_IMPORTED_MODULE_2__.FormatType.Azimuth) {
|
|
335167
|
+
const result = this.processBearingAndAzimuth(magnitude, spec);
|
|
335168
|
+
magnitude = result.magnitude;
|
|
335169
|
+
prefix = result.prefix ?? "";
|
|
335170
|
+
suffix = result.suffix ?? "";
|
|
335171
|
+
}
|
|
335155
335172
|
let formattedMagnitude = "";
|
|
335156
335173
|
if (spec.format.hasUnits) {
|
|
335157
|
-
|
|
335174
|
+
const compositeResult = Formatter.formatComposite(magnitude, spec);
|
|
335175
|
+
formattedMagnitude = compositeResult.componentText;
|
|
335176
|
+
// Override the sign detection with the composite conversion result
|
|
335177
|
+
valueIsNegative = compositeResult.isNegative;
|
|
335158
335178
|
}
|
|
335159
335179
|
else {
|
|
335160
335180
|
// unitless quantity
|
|
@@ -335165,7 +335185,12 @@ class Formatter {
|
|
|
335165
335185
|
else
|
|
335166
335186
|
formattedMagnitude = formattedMagnitude + spec.format.uomSeparator + spec.unitConversions[0].label;
|
|
335167
335187
|
}
|
|
335188
|
+
// For unitless quantities, keep original sign detection
|
|
335168
335189
|
}
|
|
335190
|
+
// Apply sign formatting based on the final determined sign
|
|
335191
|
+
const signFormatting = this.applySignFormatting(valueIsNegative, spec.format.showSignOption, spec.format.type);
|
|
335192
|
+
prefix += signFormatting.prefix;
|
|
335193
|
+
suffix = signFormatting.suffix + suffix;
|
|
335169
335194
|
// add Sign prefix and suffix as necessary
|
|
335170
335195
|
if ((prefix.length > 0 || suffix.length > 0) && formattedMagnitude.length > 0)
|
|
335171
335196
|
formattedValue = prefix + formattedMagnitude + suffix;
|
|
@@ -335186,7 +335211,8 @@ class Formatter {
|
|
|
335186
335211
|
magnitude -= quarterRevolution;
|
|
335187
335212
|
quadrant++;
|
|
335188
335213
|
}
|
|
335189
|
-
let prefix
|
|
335214
|
+
let prefix = "";
|
|
335215
|
+
let suffix = "";
|
|
335190
335216
|
// Quadrants are
|
|
335191
335217
|
// 3 0
|
|
335192
335218
|
// 2 1
|
|
@@ -335213,7 +335239,7 @@ class Formatter {
|
|
|
335213
335239
|
prefix = "N";
|
|
335214
335240
|
}
|
|
335215
335241
|
}
|
|
335216
|
-
return { magnitude, prefix, suffix
|
|
335242
|
+
return { magnitude, prefix, suffix };
|
|
335217
335243
|
}
|
|
335218
335244
|
if (type === _FormatEnums__WEBPACK_IMPORTED_MODULE_2__.FormatType.Azimuth) {
|
|
335219
335245
|
let azimuthBase = 0; // default base is North
|
|
@@ -337455,18 +337481,18 @@ class Settings {
|
|
|
337455
337481
|
}
|
|
337456
337482
|
}
|
|
337457
337483
|
toString() {
|
|
337458
|
-
return `Configurations:
|
|
337459
|
-
backend location: ${this.Backend.location},
|
|
337460
|
-
backend name: ${this.Backend.name},
|
|
337461
|
-
backend version: ${this.Backend.version},
|
|
337462
|
-
oidc client id: ${this.oidcClientId},
|
|
337463
|
-
oidc scopes: ${this.oidcScopes},
|
|
337464
|
-
applicationId: ${this.gprid},
|
|
337465
|
-
log level: ${this.logLevel},
|
|
337466
|
-
testing iModelTileRpcTests: ${this.runiModelTileRpcTests},
|
|
337467
|
-
testing PresentationRpcTest: ${this.runPresentationRpcTests},
|
|
337468
|
-
testing iModelReadRpcTests: ${this.runiModelReadRpcTests},
|
|
337469
|
-
testing DevToolsRpcTests: ${this.runDevToolsRpcTests},
|
|
337484
|
+
return `Configurations:
|
|
337485
|
+
backend location: ${this.Backend.location},
|
|
337486
|
+
backend name: ${this.Backend.name},
|
|
337487
|
+
backend version: ${this.Backend.version},
|
|
337488
|
+
oidc client id: ${this.oidcClientId},
|
|
337489
|
+
oidc scopes: ${this.oidcScopes},
|
|
337490
|
+
applicationId: ${this.gprid},
|
|
337491
|
+
log level: ${this.logLevel},
|
|
337492
|
+
testing iModelTileRpcTests: ${this.runiModelTileRpcTests},
|
|
337493
|
+
testing PresentationRpcTest: ${this.runPresentationRpcTests},
|
|
337494
|
+
testing iModelReadRpcTests: ${this.runiModelReadRpcTests},
|
|
337495
|
+
testing DevToolsRpcTests: ${this.runDevToolsRpcTests},
|
|
337470
337496
|
testing iModelWriteRpcTests: ${this.runiModelWriteRpcTests}`;
|
|
337471
337497
|
}
|
|
337472
337498
|
}
|
|
@@ -337680,7 +337706,7 @@ class TestContext {
|
|
|
337680
337706
|
this.initializeRpcInterfaces({ title: this.settings.Backend.name, version: this.settings.Backend.version });
|
|
337681
337707
|
const iModelClient = new imodels_client_management_1.IModelsClient({ api: { baseUrl: `https://${process.env.IMJS_URL_PREFIX ?? ""}api.bentley.com/imodels` } });
|
|
337682
337708
|
await core_frontend_1.NoRenderApp.startup({
|
|
337683
|
-
applicationVersion: "5.3.0-dev.
|
|
337709
|
+
applicationVersion: "5.3.0-dev.5",
|
|
337684
337710
|
applicationId: this.settings.gprid,
|
|
337685
337711
|
authorizationClient: new frontend_1.TestFrontendAuthorizationClient(this.serviceAuthToken),
|
|
337686
337712
|
hubAccess: new imodels_access_frontend_1.FrontendIModelsAccess(iModelClient),
|
|
@@ -362947,7 +362973,7 @@ var loadLanguages = instance.loadLanguages;
|
|
|
362947
362973
|
/***/ ((module) => {
|
|
362948
362974
|
|
|
362949
362975
|
"use strict";
|
|
362950
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.3.0-dev.
|
|
362976
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.3.0-dev.5","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 && npm run -s copy:draco","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 -g 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","copy:draco":"cpx \\"./node_modules/@loaders.gl/draco/dist/libs/*\\" ./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","lint-deprecation":"eslint --fix -f visualstudio --no-inline-config -c ../../common/config/eslint/eslint.config.deprecation-policy.js \\"./src/**/*.ts\\"","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","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:*","@itwin/ecschema-metadata":"workspace:*","@itwin/ecschema-rpcinterface-common":"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/ecschema-metadata":"workspace:*","@itwin/ecschema-rpcinterface-common":"workspace:*","@itwin/eslint-plugin":"5.2.2-dev.2","@types/chai-as-promised":"^7","@types/draco3d":"^1.4.10","@types/sinon":"^17.0.2","@vitest/browser":"^3.0.6","@vitest/coverage-v8":"^3.0.6","cpx2":"^8.0.0","eslint":"^9.31.0","glob":"^10.3.12","playwright":"~1.47.1","rimraf":"^6.0.1","sinon":"^17.0.2","source-map-loader":"^5.0.0","typescript":"~5.6.2","typemoq":"^2.1.0","vitest":"^3.0.6","vite-multiple-assets":"^1.3.1","vite-plugin-static-copy":"2.2.0","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.3.0","@itwin/core-i18n":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^4.3.4","@loaders.gl/draco":"^4.3.4","fuse.js":"^3.3.0","wms-capabilities":"0.4.0"}}');
|
|
362951
362977
|
|
|
362952
362978
|
/***/ }),
|
|
362953
362979
|
|