@itwin/ecschema-rpcinterface-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.
@@ -35922,6 +35922,7 @@ function isBinaryImageSource(source) {
35922
35922
  __webpack_require__.r(__webpack_exports__);
35923
35923
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
35924
35924
  /* harmony export */ getPullChangesIpcChannel: () => (/* binding */ getPullChangesIpcChannel),
35925
+ /* harmony export */ getPushChangesIpcChannel: () => (/* binding */ getPushChangesIpcChannel),
35925
35926
  /* harmony export */ ipcAppChannels: () => (/* binding */ ipcAppChannels)
35926
35927
  /* harmony export */ });
35927
35928
  /*---------------------------------------------------------------------------------------------
@@ -35932,9 +35933,16 @@ __webpack_require__.r(__webpack_exports__);
35932
35933
  * @module NativeApp
35933
35934
  */
35934
35935
  /** Get IPC channel name used for reporting progress of pulling changes into iModel.
35936
+ * @param key the key of the briefcase being pulled into.
35935
35937
  * @internal
35936
35938
  */
35937
- const getPullChangesIpcChannel = (iModelId) => `${ipcAppChannels.functions}/pullChanges/${iModelId}`;
35939
+ const getPullChangesIpcChannel = (key) => `${ipcAppChannels.functions}/pullChanges/${key}`;
35940
+ /** Get IPC channel name used for reporting the progress of the changeset download that [[IpcAppFunctions.pushChanges]] performs before
35941
+ * uploading. Kept distinct from [[getPullChangesIpcChannel]] so that a listener attached for a pull never observes a push's download.
35942
+ * @param key the key of the briefcase being pushed from.
35943
+ * @internal
35944
+ */
35945
+ const getPushChangesIpcChannel = (key) => `${ipcAppChannels.functions}/pushChanges/pullProgress/${key}`;
35938
35946
  /** @internal */
35939
35947
  const ipcAppChannels = {
35940
35948
  functions: "itwinjs-core/ipc-app",
@@ -45770,6 +45778,7 @@ __webpack_require__.r(__webpack_exports__);
45770
45778
  /* harmony export */ getMarkerText: () => (/* reexport safe */ _annotation_TextBlock__WEBPACK_IMPORTED_MODULE_3__.getMarkerText),
45771
45779
  /* harmony export */ getMaximumMajorTileFormatVersion: () => (/* reexport safe */ _tile_TileMetadata__WEBPACK_IMPORTED_MODULE_163__.getMaximumMajorTileFormatVersion),
45772
45780
  /* harmony export */ getPullChangesIpcChannel: () => (/* reexport safe */ _IpcAppProps__WEBPACK_IMPORTED_MODULE_80__.getPullChangesIpcChannel),
45781
+ /* harmony export */ getPushChangesIpcChannel: () => (/* reexport safe */ _IpcAppProps__WEBPACK_IMPORTED_MODULE_80__.getPushChangesIpcChannel),
45773
45782
  /* harmony export */ getTileObjectReference: () => (/* reexport safe */ _TileProps__WEBPACK_IMPORTED_MODULE_122__.getTileObjectReference),
45774
45783
  /* harmony export */ iModelTileTreeIdToString: () => (/* reexport safe */ _tile_TileMetadata__WEBPACK_IMPORTED_MODULE_163__.iModelTileTreeIdToString),
45775
45784
  /* harmony export */ iTwinChannel: () => (/* reexport safe */ _ipc_IpcSocket__WEBPACK_IMPORTED_MODULE_74__.iTwinChannel),
@@ -85540,29 +85549,38 @@ class BriefcaseConnection extends _IModelConnection__WEBPACK_IMPORTED_MODULE_5__
85540
85549
  async abandonChanges() {
85541
85550
  await _IpcApp__WEBPACK_IMPORTED_MODULE_6__.IpcApp.appFunctionIpc.abandonChanges(this.key); // eslint-disable-line @typescript-eslint/no-deprecated
85542
85551
  }
85552
+ /** Subscribes to changeset download progress events on `channel` and wires `abortSignal` to `cancel`.
85553
+ * @returns a function that removes every listener that was added.
85554
+ */
85555
+ listenForChangesetDownloadProgress(args) {
85556
+ const { channel, cancel, downloadProgressCallback, abortSignal } = args;
85557
+ const removeListeners = [];
85558
+ if (downloadProgressCallback) {
85559
+ const handleProgress = (_evt, data) => downloadProgressCallback(data);
85560
+ removeListeners.push(_IpcApp__WEBPACK_IMPORTED_MODULE_6__.IpcApp.addListener(channel, handleProgress));
85561
+ }
85562
+ if (abortSignal) {
85563
+ const abort = () => void cancel();
85564
+ abortSignal.addEventListener("abort", abort);
85565
+ removeListeners.push(() => abortSignal.removeEventListener("abort", abort));
85566
+ }
85567
+ return () => removeListeners.forEach((remove) => remove());
85568
+ }
85543
85569
  /** Pull (and potentially merge if there are local changes) up to a specified changeset from iModelHub into this briefcase
85544
85570
  * @param toIndex The changeset index to pull changes to. If `undefined`, pull all changes.
85545
85571
  * @param options Options for pulling changes.
85546
85572
  * @see [[BriefcaseTxns.onChangesPulled]] for the event dispatched after changes are pulled.
85547
85573
  */
85548
85574
  async pullChanges(toIndex, options) {
85549
- const removeListeners = [];
85550
- const shouldReportProgress = !!options?.downloadProgressCallback;
85551
- if (shouldReportProgress) {
85552
- const handleProgress = (_evt, data) => {
85553
- options?.downloadProgressCallback?.(data);
85554
- };
85555
- const removeProgressListener = _IpcApp__WEBPACK_IMPORTED_MODULE_6__.IpcApp.addListener((0,_itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.getPullChangesIpcChannel)(this.iModelId), handleProgress);
85556
- removeListeners.push(removeProgressListener);
85557
- }
85558
- if (options?.abortSignal) {
85559
- const abort = () => void _IpcApp__WEBPACK_IMPORTED_MODULE_6__.IpcApp.appFunctionIpc.cancelPullChangesRequest(this.key);
85560
- options?.abortSignal.addEventListener("abort", abort);
85561
- removeListeners.push(() => options?.abortSignal?.removeEventListener("abort", abort));
85562
- }
85563
85575
  this.requireTimeline();
85576
+ const removeListeners = this.listenForChangesetDownloadProgress({
85577
+ channel: (0,_itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.getPullChangesIpcChannel)(this.key),
85578
+ cancel: async () => _IpcApp__WEBPACK_IMPORTED_MODULE_6__.IpcApp.appFunctionIpc.cancelPullChangesRequest(this.key),
85579
+ downloadProgressCallback: options?.downloadProgressCallback,
85580
+ abortSignal: options?.abortSignal,
85581
+ });
85564
85582
  const ipcAppOptions = {
85565
- reportProgress: shouldReportProgress,
85583
+ reportProgress: !!options?.downloadProgressCallback,
85566
85584
  progressInterval: options?.progressInterval,
85567
85585
  enableCancellation: !!options?.abortSignal,
85568
85586
  };
@@ -85570,18 +85588,29 @@ class BriefcaseConnection extends _IModelConnection__WEBPACK_IMPORTED_MODULE_5__
85570
85588
  this.changeset = await _IpcApp__WEBPACK_IMPORTED_MODULE_6__.IpcApp.appFunctionIpc.pullChanges(this.key, toIndex, ipcAppOptions);
85571
85589
  }
85572
85590
  finally {
85573
- removeListeners.forEach((remove) => remove());
85591
+ removeListeners();
85574
85592
  }
85575
85593
  await this.invalidateSchemaViewIfChanged();
85576
85594
  }
85577
- /** Create a changeset from local Txns and push to iModelHub. On success, clear Txn table.
85578
- * @param description The description for the changeset
85579
- * @returns the changesetId of the pushed changes
85580
- * @see [[BriefcaseTxns.onChangesPushed]] for the event dispatched after changes are pushed.
85581
- */
85582
- async pushChanges(description) {
85595
+ async pushChanges(description, options) {
85583
85596
  this.requireTimeline();
85584
- return this.changeset = await _IpcApp__WEBPACK_IMPORTED_MODULE_6__.IpcApp.appFunctionIpc.pushChanges(this.key, description);
85597
+ const removeListeners = this.listenForChangesetDownloadProgress({
85598
+ channel: (0,_itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.getPushChangesIpcChannel)(this.key),
85599
+ cancel: async () => _IpcApp__WEBPACK_IMPORTED_MODULE_6__.IpcApp.appFunctionIpc.cancelPushChangesRequest(this.key),
85600
+ downloadProgressCallback: options?.downloadProgressCallback,
85601
+ abortSignal: options?.abortSignal,
85602
+ });
85603
+ const ipcAppOptions = {
85604
+ reportDownloadProgress: !!options?.downloadProgressCallback,
85605
+ downloadProgressInterval: options?.downloadProgressInterval,
85606
+ enableCancellation: !!options?.abortSignal,
85607
+ };
85608
+ try {
85609
+ return this.changeset = await _IpcApp__WEBPACK_IMPORTED_MODULE_6__.IpcApp.appFunctionIpc.pushChanges(this.key, description, ipcAppOptions);
85610
+ }
85611
+ finally {
85612
+ removeListeners();
85613
+ }
85585
85614
  }
85586
85615
  /** The current graphical editing scope, if one is in progress.
85587
85616
  * @see [[enterEditingScope]] to begin graphical editing.
@@ -295925,23 +295954,9 @@ class ITwinLocalization {
295925
295954
  this.i18next.loadNamespaces(name, (err) => {
295926
295955
  if (!err)
295927
295956
  return resolve();
295928
- // Here we got a non-null err object.
295929
- // This method is called when the system has attempted to load the resources for the namespaces for each possible locale.
295930
- // For example 'fr-ca' might be the most specific locale, in which case 'fr' and 'en' are fallback locales.
295931
- // Using Backend from i18next-http-backend, err will be an array of strings of each namespace it tried to read and its locale.
295932
- // 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.
295933
- let locales = this.getLanguageList().map((thisLocale) => `/${thisLocale}/`);
295934
- try {
295935
- for (const thisError of err) {
295936
- if (typeof thisError === "string")
295937
- locales = locales.filter((thisLocale) => !thisError.includes(thisLocale));
295938
- }
295939
- }
295940
- catch {
295941
- locales = [];
295942
- }
295943
- // if we removed every locale from the array, it wasn't loaded.
295944
- if (locales.length === 0)
295957
+ // i18next can return errors from other concurrent namespace loads in this callback.
295958
+ const wasLoaded = this.getLanguageList().some((language) => this.i18next.hasResourceBundle(language, name));
295959
+ if (!wasLoaded)
295945
295960
  _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_3__.Logger.logError("i18n", `No resources for namespace ${name} could be loaded`);
295946
295961
  resolve();
295947
295962
  });
@@ -336955,7 +336970,7 @@ class WMS {
336955
336970
  (module) {
336956
336971
 
336957
336972
  "use strict";
336958
- 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"}}');
336973
+ 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"}}');
336959
336974
 
336960
336975
  /***/ }
336961
336976