@itwin/rpcinterface-full-stack-tests 5.14.0-dev.8 → 5.14.0-dev.9

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.
@@ -55931,6 +55931,7 @@ function isBinaryImageSource(source) {
55931
55931
  __webpack_require__.r(__webpack_exports__);
55932
55932
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
55933
55933
  /* harmony export */ getPullChangesIpcChannel: () => (/* binding */ getPullChangesIpcChannel),
55934
+ /* harmony export */ getPushChangesIpcChannel: () => (/* binding */ getPushChangesIpcChannel),
55934
55935
  /* harmony export */ ipcAppChannels: () => (/* binding */ ipcAppChannels)
55935
55936
  /* harmony export */ });
55936
55937
  /*---------------------------------------------------------------------------------------------
@@ -55941,9 +55942,16 @@ __webpack_require__.r(__webpack_exports__);
55941
55942
  * @module NativeApp
55942
55943
  */
55943
55944
  /** Get IPC channel name used for reporting progress of pulling changes into iModel.
55945
+ * @param key the key of the briefcase being pulled into.
55944
55946
  * @internal
55945
55947
  */
55946
- const getPullChangesIpcChannel = (iModelId) => `${ipcAppChannels.functions}/pullChanges/${iModelId}`;
55948
+ const getPullChangesIpcChannel = (key) => `${ipcAppChannels.functions}/pullChanges/${key}`;
55949
+ /** Get IPC channel name used for reporting the progress of the changeset download that [[IpcAppFunctions.pushChanges]] performs before
55950
+ * uploading. Kept distinct from [[getPullChangesIpcChannel]] so that a listener attached for a pull never observes a push's download.
55951
+ * @param key the key of the briefcase being pushed from.
55952
+ * @internal
55953
+ */
55954
+ const getPushChangesIpcChannel = (key) => `${ipcAppChannels.functions}/pushChanges/pullProgress/${key}`;
55947
55955
  /** @internal */
55948
55956
  const ipcAppChannels = {
55949
55957
  functions: "itwinjs-core/ipc-app",
@@ -65779,6 +65787,7 @@ __webpack_require__.r(__webpack_exports__);
65779
65787
  /* harmony export */ getMarkerText: () => (/* reexport safe */ _annotation_TextBlock__WEBPACK_IMPORTED_MODULE_3__.getMarkerText),
65780
65788
  /* harmony export */ getMaximumMajorTileFormatVersion: () => (/* reexport safe */ _tile_TileMetadata__WEBPACK_IMPORTED_MODULE_163__.getMaximumMajorTileFormatVersion),
65781
65789
  /* harmony export */ getPullChangesIpcChannel: () => (/* reexport safe */ _IpcAppProps__WEBPACK_IMPORTED_MODULE_80__.getPullChangesIpcChannel),
65790
+ /* harmony export */ getPushChangesIpcChannel: () => (/* reexport safe */ _IpcAppProps__WEBPACK_IMPORTED_MODULE_80__.getPushChangesIpcChannel),
65782
65791
  /* harmony export */ getTileObjectReference: () => (/* reexport safe */ _TileProps__WEBPACK_IMPORTED_MODULE_122__.getTileObjectReference),
65783
65792
  /* harmony export */ iModelTileTreeIdToString: () => (/* reexport safe */ _tile_TileMetadata__WEBPACK_IMPORTED_MODULE_163__.iModelTileTreeIdToString),
65784
65793
  /* harmony export */ iTwinChannel: () => (/* reexport safe */ _ipc_IpcSocket__WEBPACK_IMPORTED_MODULE_74__.iTwinChannel),
@@ -105549,29 +105558,38 @@ class BriefcaseConnection extends _IModelConnection__WEBPACK_IMPORTED_MODULE_5__
105549
105558
  async abandonChanges() {
105550
105559
  await _IpcApp__WEBPACK_IMPORTED_MODULE_6__.IpcApp.appFunctionIpc.abandonChanges(this.key); // eslint-disable-line @typescript-eslint/no-deprecated
105551
105560
  }
105561
+ /** Subscribes to changeset download progress events on `channel` and wires `abortSignal` to `cancel`.
105562
+ * @returns a function that removes every listener that was added.
105563
+ */
105564
+ listenForChangesetDownloadProgress(args) {
105565
+ const { channel, cancel, downloadProgressCallback, abortSignal } = args;
105566
+ const removeListeners = [];
105567
+ if (downloadProgressCallback) {
105568
+ const handleProgress = (_evt, data) => downloadProgressCallback(data);
105569
+ removeListeners.push(_IpcApp__WEBPACK_IMPORTED_MODULE_6__.IpcApp.addListener(channel, handleProgress));
105570
+ }
105571
+ if (abortSignal) {
105572
+ const abort = () => void cancel();
105573
+ abortSignal.addEventListener("abort", abort);
105574
+ removeListeners.push(() => abortSignal.removeEventListener("abort", abort));
105575
+ }
105576
+ return () => removeListeners.forEach((remove) => remove());
105577
+ }
105552
105578
  /** Pull (and potentially merge if there are local changes) up to a specified changeset from iModelHub into this briefcase
105553
105579
  * @param toIndex The changeset index to pull changes to. If `undefined`, pull all changes.
105554
105580
  * @param options Options for pulling changes.
105555
105581
  * @see [[BriefcaseTxns.onChangesPulled]] for the event dispatched after changes are pulled.
105556
105582
  */
105557
105583
  async pullChanges(toIndex, options) {
105558
- const removeListeners = [];
105559
- const shouldReportProgress = !!options?.downloadProgressCallback;
105560
- if (shouldReportProgress) {
105561
- const handleProgress = (_evt, data) => {
105562
- options?.downloadProgressCallback?.(data);
105563
- };
105564
- const removeProgressListener = _IpcApp__WEBPACK_IMPORTED_MODULE_6__.IpcApp.addListener((0,_itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.getPullChangesIpcChannel)(this.iModelId), handleProgress);
105565
- removeListeners.push(removeProgressListener);
105566
- }
105567
- if (options?.abortSignal) {
105568
- const abort = () => void _IpcApp__WEBPACK_IMPORTED_MODULE_6__.IpcApp.appFunctionIpc.cancelPullChangesRequest(this.key);
105569
- options?.abortSignal.addEventListener("abort", abort);
105570
- removeListeners.push(() => options?.abortSignal?.removeEventListener("abort", abort));
105571
- }
105572
105584
  this.requireTimeline();
105585
+ const removeListeners = this.listenForChangesetDownloadProgress({
105586
+ channel: (0,_itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.getPullChangesIpcChannel)(this.key),
105587
+ cancel: async () => _IpcApp__WEBPACK_IMPORTED_MODULE_6__.IpcApp.appFunctionIpc.cancelPullChangesRequest(this.key),
105588
+ downloadProgressCallback: options?.downloadProgressCallback,
105589
+ abortSignal: options?.abortSignal,
105590
+ });
105573
105591
  const ipcAppOptions = {
105574
- reportProgress: shouldReportProgress,
105592
+ reportProgress: !!options?.downloadProgressCallback,
105575
105593
  progressInterval: options?.progressInterval,
105576
105594
  enableCancellation: !!options?.abortSignal,
105577
105595
  };
@@ -105579,18 +105597,29 @@ class BriefcaseConnection extends _IModelConnection__WEBPACK_IMPORTED_MODULE_5__
105579
105597
  this.changeset = await _IpcApp__WEBPACK_IMPORTED_MODULE_6__.IpcApp.appFunctionIpc.pullChanges(this.key, toIndex, ipcAppOptions);
105580
105598
  }
105581
105599
  finally {
105582
- removeListeners.forEach((remove) => remove());
105600
+ removeListeners();
105583
105601
  }
105584
105602
  await this.invalidateSchemaViewIfChanged();
105585
105603
  }
105586
- /** Create a changeset from local Txns and push to iModelHub. On success, clear Txn table.
105587
- * @param description The description for the changeset
105588
- * @returns the changesetId of the pushed changes
105589
- * @see [[BriefcaseTxns.onChangesPushed]] for the event dispatched after changes are pushed.
105590
- */
105591
- async pushChanges(description) {
105604
+ async pushChanges(description, options) {
105592
105605
  this.requireTimeline();
105593
- return this.changeset = await _IpcApp__WEBPACK_IMPORTED_MODULE_6__.IpcApp.appFunctionIpc.pushChanges(this.key, description);
105606
+ const removeListeners = this.listenForChangesetDownloadProgress({
105607
+ channel: (0,_itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.getPushChangesIpcChannel)(this.key),
105608
+ cancel: async () => _IpcApp__WEBPACK_IMPORTED_MODULE_6__.IpcApp.appFunctionIpc.cancelPushChangesRequest(this.key),
105609
+ downloadProgressCallback: options?.downloadProgressCallback,
105610
+ abortSignal: options?.abortSignal,
105611
+ });
105612
+ const ipcAppOptions = {
105613
+ reportDownloadProgress: !!options?.downloadProgressCallback,
105614
+ downloadProgressInterval: options?.downloadProgressInterval,
105615
+ enableCancellation: !!options?.abortSignal,
105616
+ };
105617
+ try {
105618
+ return this.changeset = await _IpcApp__WEBPACK_IMPORTED_MODULE_6__.IpcApp.appFunctionIpc.pushChanges(this.key, description, ipcAppOptions);
105619
+ }
105620
+ finally {
105621
+ removeListeners();
105622
+ }
105594
105623
  }
105595
105624
  /** The current graphical editing scope, if one is in progress.
105596
105625
  * @see [[enterEditingScope]] to begin graphical editing.
@@ -315934,23 +315963,9 @@ class ITwinLocalization {
315934
315963
  this.i18next.loadNamespaces(name, (err) => {
315935
315964
  if (!err)
315936
315965
  return resolve();
315937
- // Here we got a non-null err object.
315938
- // This method is called when the system has attempted to load the resources for the namespaces for each possible locale.
315939
- // For example 'fr-ca' might be the most specific locale, in which case 'fr' and 'en' are fallback locales.
315940
- // Using Backend from i18next-http-backend, err will be an array of strings of each namespace it tried to read and its locale.
315941
- // There might be errs for some other namespaces as well as this one. We resolve the promise unless there's an error for each possible locale.
315942
- let locales = this.getLanguageList().map((thisLocale) => `/${thisLocale}/`);
315943
- try {
315944
- for (const thisError of err) {
315945
- if (typeof thisError === "string")
315946
- locales = locales.filter((thisLocale) => !thisError.includes(thisLocale));
315947
- }
315948
- }
315949
- catch {
315950
- locales = [];
315951
- }
315952
- // if we removed every locale from the array, it wasn't loaded.
315953
- if (locales.length === 0)
315966
+ // i18next can return errors from other concurrent namespace loads in this callback.
315967
+ const wasLoaded = this.getLanguageList().some((language) => this.i18next.hasResourceBundle(language, name));
315968
+ if (!wasLoaded)
315954
315969
  _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_3__.Logger.logError("i18n", `No resources for namespace ${name} could be loaded`);
315955
315970
  resolve();
315956
315971
  });
@@ -343375,7 +343390,7 @@ class TestContext {
343375
343390
  this.initializeRpcInterfaces({ title: this.settings.Backend.name, version: this.settings.Backend.version });
343376
343391
  const iModelClient = new imodels_client_management_1.IModelsClient({ api: { baseUrl: `https://${process.env.IMJS_URL_PREFIX ?? ""}api.bentley.com/imodels` } });
343377
343392
  await core_frontend_1.NoRenderApp.startup({
343378
- applicationVersion: "5.14.0-dev.8",
343393
+ applicationVersion: "5.14.0-dev.9",
343379
343394
  applicationId: this.settings.gprid,
343380
343395
  authorizationClient: new frontend_1.TestFrontendAuthorizationClient(this.serviceAuthToken),
343381
343396
  hubAccess: new imodels_access_frontend_1.FrontendIModelsAccess(iModelClient),
@@ -370117,7 +370132,7 @@ class WMS {
370117
370132
  (module) {
370118
370133
 
370119
370134
  "use strict";
370120
- module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.14.0-dev.8","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 build: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: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 && npm run -s extract","extract":"betools extract --fileExt=ts --extractFrom=./src/test/example-code --recursive --out=../../generated-docs/extract","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 build:test-worker && vitest --run","cover":"npm run build:test-worker && vitest --run","build:test-worker":"vite build --config ./src/test/worker/vite.config.mts 1>&2","build:workers":"rimraf lib/workers/webpack && vite build --config ./src/workers/ImdlParser/vite.config.mts 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":{"@bentley/aec-units-schema":"^1.0.3","@bentley/formats-schema":"^1.0.0","@bentley/units-schema":"^1.0.11","@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/object-storage-core":"^3.0.4","@itwin/eslint-plugin":"^6.0.0","@types/node":"~20.17.0","@types/sinon":"^17.0.2","@vitest/browser-playwright":"^4.1.10","@vitest/coverage-v8":"^4.1.10","cpx2":"^8.0.0","eslint":"^9.31.0","playwright":"~1.56.1","rimraf":"^6.0.1","sinon":"^17.0.2","typescript":"~5.6.2","vite":"^6.4.3","vitest":"^4.1.10","vite-plugin-static-copy":"2.2.0"},"//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/core-i18n":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^4.4.5","@loaders.gl/draco":"^4.4.5","fuse.js":"^3.3.0","wms-capabilities":"0.6.0"}}');
370135
+ module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.14.0-dev.9","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 build: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: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 && npm run -s extract","extract":"betools extract --fileExt=ts --extractFrom=./src/test/example-code --recursive --out=../../generated-docs/extract","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 build:test-worker && vitest --run","cover":"npm run build:test-worker && vitest --run","build:test-worker":"vite build --config ./src/test/worker/vite.config.mts 1>&2","build:workers":"rimraf lib/workers/webpack && vite build --config ./src/workers/ImdlParser/vite.config.mts 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":{"@bentley/aec-units-schema":"^1.0.3","@bentley/formats-schema":"^1.0.0","@bentley/units-schema":"^1.0.11","@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/object-storage-core":"^3.0.4","@itwin/eslint-plugin":"^6.0.0","@types/node":"~20.17.0","@types/sinon":"^17.0.2","@vitest/browser-playwright":"^4.1.10","@vitest/coverage-v8":"^4.1.10","cpx2":"^8.0.0","eslint":"^9.31.0","playwright":"~1.56.1","rimraf":"^6.0.1","sinon":"^17.0.2","typescript":"~5.6.2","vite":"^6.4.3","vitest":"^4.1.10","vite-plugin-static-copy":"2.2.0"},"//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/core-i18n":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^4.4.5","@loaders.gl/draco":"^4.4.5","fuse.js":"^3.3.0","wms-capabilities":"0.6.0"}}');
370121
370136
 
370122
370137
  /***/ },
370123
370138