@itwin/rpcinterface-full-stack-tests 4.0.0-dev.40 → 4.0.0-dev.41

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.
@@ -1 +1 @@
1
- {"version":3,"file":"_d48c.bundled-tests.js","mappings":";;;;;;;;AAAA","sources":["file:///ignored|D:\\vsts_b\\57\\s\\common\\temp\\node_modules\\.pnpm\\@loaders.gl+worker-utils@3.3.1\\node_modules\\@loaders.gl\\worker-utils\\dist\\esm\\lib\\library-utils|../node/require-utils.node"],"names":[],"sourceRoot":""}
1
+ {"version":3,"file":"_d48c.bundled-tests.js","mappings":";;;;;;;;AAAA","sources":["file:///ignored|D:\\vsts_a\\4\\s\\common\\temp\\node_modules\\.pnpm\\@loaders.gl+worker-utils@3.3.1\\node_modules\\@loaders.gl\\worker-utils\\dist\\esm\\lib\\library-utils|../node/require-utils.node"],"names":[],"sourceRoot":""}
@@ -280084,7 +280084,7 @@ class TestContext {
280084
280084
  this.initializeRpcInterfaces({ title: this.settings.Backend.name, version: this.settings.Backend.version });
280085
280085
  const iModelClient = new imodels_client_management_1.IModelsClient({ api: { baseUrl: `https://${process.env.IMJS_URL_PREFIX ?? ""}api.bentley.com/imodels` } });
280086
280086
  await core_frontend_1.NoRenderApp.startup({
280087
- applicationVersion: "4.0.0-dev.40",
280087
+ applicationVersion: "4.0.0-dev.41",
280088
280088
  applicationId: this.settings.gprid,
280089
280089
  authorizationClient: new frontend_1.TestFrontendAuthorizationClient(this.adminUserAccessToken),
280090
280090
  hubAccess: new imodels_access_frontend_1.FrontendIModelsAccess(iModelClient),
@@ -282104,6 +282104,11 @@ __webpack_require__.r(__webpack_exports__);
282104
282104
 
282105
282105
 
282106
282106
 
282107
+ /**
282108
+ * Default timeout for how long we're going to wait for RPC request to be fulfilled before throwing
282109
+ * a timeout error.
282110
+ */
282111
+ const DEFAULT_REQUEST_TIMEOUT = 10 * 60 * 1000; // 10 minutes
282107
282112
  /**
282108
282113
  * RPC requests handler that wraps [[PresentationRpcInterface]] and
282109
282114
  * adds handling for cases when backend needs to be synced with client
@@ -282113,63 +282118,53 @@ __webpack_require__.r(__webpack_exports__);
282113
282118
  */
282114
282119
  class RpcRequestsHandler {
282115
282120
  constructor(props) {
282116
- this.maxRequestRepeatCount = 5;
282117
- this.clientId = (props && props.clientId) ? props.clientId : _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Guid.createValue();
282118
- }
282119
- dispose() {
282121
+ this.clientId = props?.clientId ?? _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Guid.createValue();
282122
+ this.timeout = props?.timeout ?? DEFAULT_REQUEST_TIMEOUT;
282120
282123
  }
282121
282124
  // eslint-disable-next-line @typescript-eslint/naming-convention
282122
282125
  get rpcClient() { return _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.RpcManager.getClientForInterface(_PresentationRpcInterface__WEBPACK_IMPORTED_MODULE_4__.PresentationRpcInterface); }
282123
- async requestRepeatedly(func, diagnosticsHandler, repeatCount = 1) {
282126
+ async requestWithTimeout(func, diagnosticsHandler) {
282127
+ const start = _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BeTimePoint.now();
282128
+ const timeout = _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BeDuration.fromMilliseconds(this.timeout);
282124
282129
  let diagnostics;
282125
- let error;
282126
- let shouldRepeat = false;
282127
- try {
282128
- const response = await func();
282129
- diagnostics = response.diagnostics;
282130
- if (response.statusCode === _Error__WEBPACK_IMPORTED_MODULE_3__.PresentationStatus.Success)
282131
- return response.result;
282132
- if (response.statusCode === _Error__WEBPACK_IMPORTED_MODULE_3__.PresentationStatus.BackendTimeout && repeatCount < this.maxRequestRepeatCount)
282133
- shouldRepeat = true;
282134
- else
282135
- error = new _Error__WEBPACK_IMPORTED_MODULE_3__.PresentationError(response.statusCode, response.errorMessage);
282136
- }
282137
- catch (e) {
282138
- error = e;
282139
- if (repeatCount < this.maxRequestRepeatCount)
282140
- shouldRepeat = true;
282141
- }
282142
- finally {
282143
- diagnosticsHandler && diagnostics && diagnosticsHandler(diagnostics);
282144
- }
282145
- if (shouldRepeat) {
282146
- ++repeatCount;
282147
- return this.requestRepeatedly(func, diagnosticsHandler, repeatCount);
282130
+ while (start.plus(timeout).isInFuture) {
282131
+ try {
282132
+ const response = await func();
282133
+ diagnostics = response.diagnostics;
282134
+ switch (response.statusCode) {
282135
+ case _Error__WEBPACK_IMPORTED_MODULE_3__.PresentationStatus.Success: return response.result;
282136
+ case _Error__WEBPACK_IMPORTED_MODULE_3__.PresentationStatus.BackendTimeout: break;
282137
+ default: throw new _Error__WEBPACK_IMPORTED_MODULE_3__.PresentationError(response.statusCode, response.errorMessage);
282138
+ }
282139
+ }
282140
+ finally {
282141
+ diagnosticsHandler && diagnostics && diagnosticsHandler(diagnostics);
282142
+ }
282148
282143
  }
282149
- throw error;
282144
+ throw new _Error__WEBPACK_IMPORTED_MODULE_3__.PresentationError(_Error__WEBPACK_IMPORTED_MODULE_3__.PresentationStatus.BackendTimeout);
282150
282145
  }
282151
282146
  /**
282152
282147
  * Send the request to backend.
282153
282148
  *
282154
- * If the backend responds with [[PresentationStatus.BackendTimeout]] or there's an RPC-related error,
282155
- * the request is repeated up to `this._maxRequestRepeatCount` times. If we fail to get a valid success or error
282156
- * response from the backend, throw the last encountered error.
282157
- *
282158
- * @internal
282149
+ * If the backend responds with [[PresentationStatus.BackendTimeout]], the request is repeated until we hit `timeout` or get
282150
+ * a response. If the response is other than [[PresentationStatus.BackendTimeout]] or [[PresentationStatus.Success]], a [[PresentationError]]
282151
+ * is thrown with the details from the response.
282159
282152
  */
282160
282153
  async request(func, options, ...additionalOptions) {
282161
282154
  const { imodel, diagnostics, ...optionsNoIModel } = options;
282162
282155
  const { handler: diagnosticsHandler, ...diagnosticsOptions } = diagnostics ?? {};
282163
- if (isOptionsWithRuleset(optionsNoIModel))
282156
+ if (isOptionsWithRuleset(optionsNoIModel)) {
282164
282157
  optionsNoIModel.rulesetOrId = cleanupRuleset(optionsNoIModel.rulesetOrId);
282158
+ }
282165
282159
  const rpcOptions = {
282166
282160
  ...optionsNoIModel,
282167
282161
  clientId: this.clientId,
282168
282162
  };
282169
- if (diagnostics)
282163
+ if (diagnostics) {
282170
282164
  rpcOptions.diagnostics = diagnosticsOptions;
282165
+ }
282171
282166
  const doRequest = async () => func(imodel, rpcOptions, ...additionalOptions);
282172
- return this.requestRepeatedly(doRequest, diagnosticsHandler);
282167
+ return this.requestWithTimeout(doRequest, diagnosticsHandler);
282173
282168
  }
282174
282169
  async getNodesCount(options) {
282175
282170
  return this.request(this.rpcClient.getNodesCount.bind(this.rpcClient), options);
@@ -286698,9 +286693,10 @@ class PresentationManager {
286698
286693
  this.handleUpdateAsync(_itwin_presentation_common__WEBPACK_IMPORTED_MODULE_2__.UpdateInfo.fromJSON(report));
286699
286694
  };
286700
286695
  if (props) {
286701
- this.activeUnitSystem = props.activeUnitSystem;
286696
+ // eslint-disable-next-line deprecation/deprecation
286697
+ this._explicitActiveUnitSystem = props.activeUnitSystem;
286702
286698
  }
286703
- this._requestsHandler = props?.rpcRequestsHandler ?? new _itwin_presentation_common__WEBPACK_IMPORTED_MODULE_2__.RpcRequestsHandler(props ? { clientId: props.clientId } : undefined);
286699
+ this._requestsHandler = props?.rpcRequestsHandler ?? new _itwin_presentation_common__WEBPACK_IMPORTED_MODULE_2__.RpcRequestsHandler(props ? { clientId: props.clientId, timeout: props.requestTimeout } : undefined);
286704
286700
  this._rulesetVars = new Map();
286705
286701
  this._rulesets = _RulesetManager__WEBPACK_IMPORTED_MODULE_5__.RulesetManagerImpl.create();
286706
286702
  this._localizationHelper = new _LocalizationHelper__WEBPACK_IMPORTED_MODULE_4__.FrontendLocalizationHelper(props?.activeLocale);
@@ -286712,11 +286708,21 @@ class PresentationManager {
286712
286708
  this._stateTracker = props?.stateTracker ?? new _StateTracker__WEBPACK_IMPORTED_MODULE_8__.StateTracker(this._ipcRequestsHandler);
286713
286709
  }
286714
286710
  }
286711
+ /**
286712
+ * Get / set active unit system used to format property values with units.
286713
+ *
286714
+ * @deprecated in 4.0. `IModelApp.quantityFormatter` should be used to get/set the active unit system. At the moment
286715
+ * [[PresentationManager]] allows overriding it, but returns `IModelApp.quantityFormatter.activeUnitSystem` if override
286716
+ * is not set.
286717
+ */
286718
+ get activeUnitSystem() {
286719
+ return this._explicitActiveUnitSystem ?? _itwin_core_frontend__WEBPACK_IMPORTED_MODULE_1__.IModelApp.quantityFormatter.activeUnitSystem;
286720
+ }
286721
+ set activeUnitSystem(value) { this._explicitActiveUnitSystem = value; }
286715
286722
  /** Get / set active locale used for localizing presentation data */
286716
286723
  get activeLocale() { return this._localizationHelper.locale; }
286717
286724
  set activeLocale(locale) { this._localizationHelper.locale = locale; }
286718
286725
  dispose() {
286719
- this._requestsHandler.dispose();
286720
286726
  if (this._clearEventListener) {
286721
286727
  this._clearEventListener();
286722
286728
  this._clearEventListener = undefined;
@@ -286752,8 +286758,9 @@ class PresentationManager {
286752
286758
  }
286753
286759
  }
286754
286760
  }
286755
- /** Function that is called when a new IModelConnection is used to retrieve data.
286756
- * @internal
286761
+ /**
286762
+ * Function that is called when a new IModelConnection is used to retrieve data.
286763
+ * @internal
286757
286764
  */
286758
286765
  async onNewiModelConnection(_) { }
286759
286766
  /**
@@ -286791,8 +286798,7 @@ class PresentationManager {
286791
286798
  const defaultOptions = {};
286792
286799
  if (this.activeLocale)
286793
286800
  defaultOptions.locale = this.activeLocale;
286794
- if (this.activeUnitSystem)
286795
- defaultOptions.unitSystem = this.activeUnitSystem;
286801
+ defaultOptions.unitSystem = this.activeUnitSystem; // eslint-disable-line deprecation/deprecation
286796
286802
  const { imodel, rulesetVariables, ...rpcRequestOptions } = requestOptions;
286797
286803
  return {
286798
286804
  ...defaultOptions,
@@ -299640,7 +299646,7 @@ module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"P
299640
299646
  /***/ ((module) => {
299641
299647
 
299642
299648
  "use strict";
299643
- module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.0.0-dev.40","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","build:ci":"npm run -s build && npm run -s build:esm","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 ES2020 --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","docs":"betools docs --includes=../../generated-docs/extract --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/primitives,**/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-eslintrc -c \\"../../tools/eslint-plugin/dist/configs/extension-exports-config.js\\" \\"./src/**/*.ts\\" 1>&2","lint":"eslint -f visualstudio \\"./src/**/*.ts\\" 1>&2","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run -s webpackTests && certa -r chrome","cover":"npm -s test","test:debug":"certa -r chrome --debug","webpackTests":"webpack --config ./src/test/utils/webpack.config.js 1>&2"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core/tree/master/core/frontend"},"keywords":["Bentley","BIM","iModel","digital-twin","iTwin"],"author":{"name":"Bentley Systems, Inc.","url":"http://www.bentley.com"},"peerDependencies":{"@itwin/appui-abstract":"workspace:^4.0.0-dev.40","@itwin/core-bentley":"workspace:^4.0.0-dev.40","@itwin/core-common":"workspace:^4.0.0-dev.40","@itwin/core-geometry":"workspace:^4.0.0-dev.40","@itwin/core-orbitgt":"workspace:^4.0.0-dev.40","@itwin/core-quantity":"workspace:^4.0.0-dev.40"},"//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/certa":"workspace:*","@itwin/eslint-plugin":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@types/chai":"4.3.1","@types/chai-as-promised":"^7","@types/deep-assign":"^0.1.0","@types/mocha":"^8.2.2","@types/node":"^18.11.5","@types/qs":"^6.5.0","@types/semver":"7.3.10","@types/superagent":"^4.1.14","@types/sinon":"^9.0.0","babel-loader":"~8.2.5","babel-plugin-istanbul":"~6.1.1","chai":"^4.1.2","chai-as-promised":"^7","cpx2":"^3.0.0","eslint":"^7.11.0","glob":"^7.1.2","mocha":"^10.0.0","nyc":"^15.1.0","rimraf":"^3.0.2","sinon":"^9.0.2","source-map-loader":"^4.0.0","typescript":"~4.4.0","webpack":"^5.64.4"},"//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/object-storage-azure":"^1.5.0","@itwin/cloud-agnostic-core":"^1.5.0","@itwin/object-storage-core":"^1.5.0","@itwin/core-i18n":"workspace:*","@itwin/core-telemetry":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","deep-assign":"^2.0.0","fuse.js":"^3.3.0","qs":"^6.5.3","semver":"^7.3.5","superagent":"^7.1.5","wms-capabilities":"0.4.0","reflect-metadata":"0.1.13"},"nyc":{"extends":"./node_modules/@itwin/build-tools/.nycrc"},"eslintConfig":{"plugins":["@itwin"],"extends":"plugin:@itwin/itwinjs-recommended","rules":{"@itwin/no-internal-barrel-imports":["error",{"required-barrel-modules":["./src/tile/internal.ts"]}],"@itwin/public-extension-exports":["error",{"releaseTags":["public","preview"],"outputApiFile":false}]},"overrides":[{"files":["*.test.ts","*.test.tsx","**/test/**/*.ts"],"rules":{"@itwin/no-internal-barrel-imports":"off"}}]}}');
299649
+ module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.0.0-dev.41","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","build:ci":"npm run -s build && npm run -s build:esm","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 ES2020 --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","docs":"betools docs --includes=../../generated-docs/extract --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/primitives,**/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-eslintrc -c \\"../../tools/eslint-plugin/dist/configs/extension-exports-config.js\\" \\"./src/**/*.ts\\" 1>&2","lint":"eslint -f visualstudio \\"./src/**/*.ts\\" 1>&2","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run -s webpackTests && certa -r chrome","cover":"npm -s test","test:debug":"certa -r chrome --debug","webpackTests":"webpack --config ./src/test/utils/webpack.config.js 1>&2"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core/tree/master/core/frontend"},"keywords":["Bentley","BIM","iModel","digital-twin","iTwin"],"author":{"name":"Bentley Systems, Inc.","url":"http://www.bentley.com"},"peerDependencies":{"@itwin/appui-abstract":"workspace:^4.0.0-dev.41","@itwin/core-bentley":"workspace:^4.0.0-dev.41","@itwin/core-common":"workspace:^4.0.0-dev.41","@itwin/core-geometry":"workspace:^4.0.0-dev.41","@itwin/core-orbitgt":"workspace:^4.0.0-dev.41","@itwin/core-quantity":"workspace:^4.0.0-dev.41"},"//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/certa":"workspace:*","@itwin/eslint-plugin":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@types/chai":"4.3.1","@types/chai-as-promised":"^7","@types/deep-assign":"^0.1.0","@types/mocha":"^8.2.2","@types/node":"^18.11.5","@types/qs":"^6.5.0","@types/semver":"7.3.10","@types/superagent":"^4.1.14","@types/sinon":"^9.0.0","babel-loader":"~8.2.5","babel-plugin-istanbul":"~6.1.1","chai":"^4.1.2","chai-as-promised":"^7","cpx2":"^3.0.0","eslint":"^7.11.0","glob":"^7.1.2","mocha":"^10.0.0","nyc":"^15.1.0","rimraf":"^3.0.2","sinon":"^9.0.2","source-map-loader":"^4.0.0","typescript":"~4.4.0","webpack":"^5.64.4"},"//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/object-storage-azure":"^1.5.0","@itwin/cloud-agnostic-core":"^1.5.0","@itwin/object-storage-core":"^1.5.0","@itwin/core-i18n":"workspace:*","@itwin/core-telemetry":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","deep-assign":"^2.0.0","fuse.js":"^3.3.0","qs":"^6.5.3","semver":"^7.3.5","superagent":"^7.1.5","wms-capabilities":"0.4.0","reflect-metadata":"0.1.13"},"nyc":{"extends":"./node_modules/@itwin/build-tools/.nycrc"},"eslintConfig":{"plugins":["@itwin"],"extends":"plugin:@itwin/itwinjs-recommended","rules":{"@itwin/no-internal-barrel-imports":["error",{"required-barrel-modules":["./src/tile/internal.ts"]}],"@itwin/public-extension-exports":["error",{"releaseTags":["public","preview"],"outputApiFile":false}]},"overrides":[{"files":["*.test.ts","*.test.tsx","**/test/**/*.ts"],"rules":{"@itwin/no-internal-barrel-imports":"off"}}]}}');
299644
299650
 
299645
299651
  /***/ }),
299646
299652