@itwin/rpcinterface-full-stack-tests 5.15.0-dev.13 → 5.15.0-dev.14
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/dist/bundled-tests.js +136 -38
- package/lib/dist/bundled-tests.js.map +1 -1
- package/lib/dist/core_frontend_lib_esm_ApproximateTerrainHeightsProps_js.bundled-tests.js.map +1 -1
- package/lib/dist/vendors-common_temp_node_modules_pnpm_cross-fetch_4_1_0_node_modules_cross-fetch_dist_browser-44272f.bundled-tests.js.map +1 -1
- package/lib/dist/vendors-common_temp_node_modules_pnpm_loaders_gl_draco_4_5_2__loaders_gl_core_4_5_2_node_modu-bbc95a.bundled-tests.js.map +1 -1
- package/package.json +15 -15
|
@@ -38476,6 +38476,7 @@ function assert(condition, message) {
|
|
|
38476
38476
|
"use strict";
|
|
38477
38477
|
__webpack_require__.r(__webpack_exports__);
|
|
38478
38478
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
38479
|
+
/* harmony export */ BeAsyncEvent: () => (/* binding */ BeAsyncEvent),
|
|
38479
38480
|
/* harmony export */ BeEvent: () => (/* binding */ BeEvent),
|
|
38480
38481
|
/* harmony export */ BeEventList: () => (/* binding */ BeEventList),
|
|
38481
38482
|
/* harmony export */ BeUiEvent: () => (/* binding */ BeUiEvent),
|
|
@@ -38563,8 +38564,13 @@ class BeEvent {
|
|
|
38563
38564
|
dropped = true;
|
|
38564
38565
|
}
|
|
38565
38566
|
else {
|
|
38567
|
+
const listener = context.listener;
|
|
38568
|
+
if (context.once) {
|
|
38569
|
+
context.listener = undefined;
|
|
38570
|
+
dropped = true;
|
|
38571
|
+
}
|
|
38566
38572
|
try {
|
|
38567
|
-
|
|
38573
|
+
listener.apply(context.scope, args);
|
|
38568
38574
|
}
|
|
38569
38575
|
catch (e) {
|
|
38570
38576
|
_UnexpectedErrors__WEBPACK_IMPORTED_MODULE_0__.UnexpectedErrors.handle(e);
|
|
@@ -38573,10 +38579,6 @@ class BeEvent {
|
|
|
38573
38579
|
// listener was removed during its own callback
|
|
38574
38580
|
dropped = true;
|
|
38575
38581
|
}
|
|
38576
|
-
else if (context.once) {
|
|
38577
|
-
context.listener = undefined;
|
|
38578
|
-
dropped = true;
|
|
38579
|
-
}
|
|
38580
38582
|
}
|
|
38581
38583
|
}
|
|
38582
38584
|
this._emitDepth--;
|
|
@@ -38620,8 +38622,6 @@ class BeUiEvent extends BeEvent {
|
|
|
38620
38622
|
*/
|
|
38621
38623
|
class BeUnorderedEvent {
|
|
38622
38624
|
_listeners = new Set();
|
|
38623
|
-
_emitDepth = 0;
|
|
38624
|
-
_hasTombstones = false;
|
|
38625
38625
|
/** The number of listeners currently subscribed to the event.
|
|
38626
38626
|
* @note During `raiseEvent()`, this may include listeners that have been removed or are one-shot
|
|
38627
38627
|
* but are awaiting deferred cleanup. The count is accurate outside of `raiseEvent()`.
|
|
@@ -38651,43 +38651,26 @@ class BeUnorderedEvent {
|
|
|
38651
38651
|
}
|
|
38652
38652
|
/** Remove a specific context entry, deferring during emit. */
|
|
38653
38653
|
_removeCtx(ctx) {
|
|
38654
|
-
|
|
38655
|
-
ctx.listener = undefined; // tombstone for deferred cleanup
|
|
38656
|
-
this._hasTombstones = true;
|
|
38657
|
-
}
|
|
38658
|
-
else {
|
|
38659
|
-
this._listeners.delete(ctx);
|
|
38660
|
-
}
|
|
38654
|
+
this._listeners.delete(ctx);
|
|
38661
38655
|
}
|
|
38662
38656
|
/**
|
|
38663
38657
|
* Raises the event by calling each registered listener with the supplied arguments.
|
|
38664
38658
|
* @param args This method takes any number of parameters and passes them through to the listeners.
|
|
38665
38659
|
*/
|
|
38666
38660
|
raiseEvent(...args) {
|
|
38667
|
-
this._emitDepth++;
|
|
38668
38661
|
for (const ctx of this._listeners) {
|
|
38669
38662
|
if (!ctx.listener) {
|
|
38670
38663
|
continue;
|
|
38671
38664
|
}
|
|
38665
|
+
if (ctx.once) {
|
|
38666
|
+
this._listeners.delete(ctx);
|
|
38667
|
+
}
|
|
38672
38668
|
try {
|
|
38673
38669
|
ctx.listener.apply(ctx.scope, args);
|
|
38674
38670
|
}
|
|
38675
38671
|
catch (e) {
|
|
38676
38672
|
_UnexpectedErrors__WEBPACK_IMPORTED_MODULE_0__.UnexpectedErrors.handle(e);
|
|
38677
38673
|
}
|
|
38678
|
-
if (ctx.listener && ctx.once) {
|
|
38679
|
-
ctx.listener = undefined;
|
|
38680
|
-
this._hasTombstones = true;
|
|
38681
|
-
}
|
|
38682
|
-
}
|
|
38683
|
-
this._emitDepth--;
|
|
38684
|
-
// Only clean up tombstoned entries when we're back at the outermost emit
|
|
38685
|
-
if (this._hasTombstones && this._emitDepth === 0) {
|
|
38686
|
-
this._hasTombstones = false;
|
|
38687
|
-
for (const ctx of this._listeners) {
|
|
38688
|
-
if (ctx.listener === undefined)
|
|
38689
|
-
this._listeners.delete(ctx);
|
|
38690
|
-
}
|
|
38691
38674
|
}
|
|
38692
38675
|
}
|
|
38693
38676
|
/** Clear all listeners from this BeUnorderedEvent.
|
|
@@ -38703,6 +38686,108 @@ class BeUnorderedUiEvent extends BeUnorderedEvent {
|
|
|
38703
38686
|
/** Raises event with single strongly typed argument. */
|
|
38704
38687
|
emit(args) { this.raiseEvent(args); }
|
|
38705
38688
|
}
|
|
38689
|
+
/**
|
|
38690
|
+
* Manages a set of *listeners* for a particular event and notifies them when the event is raised.
|
|
38691
|
+
* Each listener is async (return a Promise<void>). The listeners may be invoked in series
|
|
38692
|
+
* or concurrently depending on the configuration of the instance.
|
|
38693
|
+
*
|
|
38694
|
+
* Like [[BeUnorderedEvent]], this class uses a `Set` internally to support more performant removal
|
|
38695
|
+
* of old listeners. When a listener is removed during emit, it is marked for deferred removal instead
|
|
38696
|
+
* of mutating the set immediately. Despite the "unordered" implication, items in a `Set` are enumerated
|
|
38697
|
+
* in insertion order, which means that this class invokes the listeners in insertion order.
|
|
38698
|
+
*
|
|
38699
|
+
* Listeners are managed exclusively through the disposal closure returned by [[addListener]] and
|
|
38700
|
+
* [[addOnce]]. There is no `removeListener` or `has` method — callers must capture the returned
|
|
38701
|
+
* closure to unsubscribe.
|
|
38702
|
+
* @beta
|
|
38703
|
+
*/
|
|
38704
|
+
class BeAsyncEvent {
|
|
38705
|
+
_listeners = new Set();
|
|
38706
|
+
_concurrent = false;
|
|
38707
|
+
_promiseRejectionIsUnexpected = false;
|
|
38708
|
+
constructor(options) {
|
|
38709
|
+
if (options?.concurrent)
|
|
38710
|
+
this._concurrent = true;
|
|
38711
|
+
if (options?.promiseRejectionIsUnexpected)
|
|
38712
|
+
this._promiseRejectionIsUnexpected = true;
|
|
38713
|
+
}
|
|
38714
|
+
/** The number of listeners currently subscribed to the event.
|
|
38715
|
+
* @note During `raiseEvent()`, this may include listeners that have been removed or are one-shot
|
|
38716
|
+
* but are awaiting deferred cleanup. The count is accurate outside of `raiseEvent()`.
|
|
38717
|
+
*/
|
|
38718
|
+
get numberOfListeners() { return this._listeners.size; }
|
|
38719
|
+
/**
|
|
38720
|
+
* Registers a Listener to be executed whenever this event is raised.
|
|
38721
|
+
* @param listener The function to be executed when the event is raised.
|
|
38722
|
+
* @param scope An optional object scope to serve as the 'this' pointer when listener is invoked.
|
|
38723
|
+
* @returns A function that will remove this event listener in O(1).
|
|
38724
|
+
*/
|
|
38725
|
+
addListener(listener, scope) {
|
|
38726
|
+
const ctx = { listener, scope, once: false };
|
|
38727
|
+
this._listeners.add(ctx);
|
|
38728
|
+
return () => this._removeCtx(ctx);
|
|
38729
|
+
}
|
|
38730
|
+
/**
|
|
38731
|
+
* Registers a callback function to be executed *only once* when the event is raised.
|
|
38732
|
+
* @param listener The function to be executed once when the event is raised.
|
|
38733
|
+
* @param scope An optional object scope to serve as the `this` pointer in which the listener function will execute.
|
|
38734
|
+
* @returns A function that will remove this event listener in O(1).
|
|
38735
|
+
*/
|
|
38736
|
+
addOnce(listener, scope) {
|
|
38737
|
+
const ctx = { listener, scope, once: true };
|
|
38738
|
+
this._listeners.add(ctx);
|
|
38739
|
+
return () => this._removeCtx(ctx);
|
|
38740
|
+
}
|
|
38741
|
+
/** Remove a specific context entry, deferring during emit. */
|
|
38742
|
+
_removeCtx(ctx) {
|
|
38743
|
+
this._listeners.delete(ctx);
|
|
38744
|
+
}
|
|
38745
|
+
/**
|
|
38746
|
+
* Raises the event by calling each registered listener with the supplied arguments.
|
|
38747
|
+
*
|
|
38748
|
+
* See [[BeAsyncEventOptions]] for options that control the behavior of this method.
|
|
38749
|
+
*
|
|
38750
|
+
* @param args This method takes any number of parameters and passes them through to the listeners.
|
|
38751
|
+
* @returns A Promise that settles when the event invocation is complete.
|
|
38752
|
+
*/
|
|
38753
|
+
async raiseEvent(...args) {
|
|
38754
|
+
const promises = [];
|
|
38755
|
+
// Wrapper to ensure that an exception thrown immediately by a listener is captured as a rejected promise rather than
|
|
38756
|
+
// allowed to propagate as an exception. A well-behaved Promise-returning function should never throw, but
|
|
38757
|
+
// this defends against the poorly-behaved ones. In Node 23+ we could use `Promise.try` instead.
|
|
38758
|
+
const invoke = async (ctx, args) => {
|
|
38759
|
+
if (!ctx.listener)
|
|
38760
|
+
return;
|
|
38761
|
+
await ctx.listener.apply(ctx.scope, args);
|
|
38762
|
+
};
|
|
38763
|
+
for (const ctx of this._listeners) {
|
|
38764
|
+
if (!ctx.listener)
|
|
38765
|
+
continue;
|
|
38766
|
+
if (ctx.once) {
|
|
38767
|
+
// Set guarantees this is safe during iteration.
|
|
38768
|
+
this._listeners.delete(ctx);
|
|
38769
|
+
}
|
|
38770
|
+
let promise = invoke(ctx, args);
|
|
38771
|
+
if (this._promiseRejectionIsUnexpected)
|
|
38772
|
+
promise = promise.catch(reason => _UnexpectedErrors__WEBPACK_IMPORTED_MODULE_0__.UnexpectedErrors.handle(reason));
|
|
38773
|
+
if (this._concurrent)
|
|
38774
|
+
promises.push(promise);
|
|
38775
|
+
else
|
|
38776
|
+
await promise;
|
|
38777
|
+
}
|
|
38778
|
+
if (this._concurrent) {
|
|
38779
|
+
const result = await Promise.allSettled(promises);
|
|
38780
|
+
const firstRejection = result.find(r => r.status === "rejected");
|
|
38781
|
+
if (firstRejection)
|
|
38782
|
+
throw firstRejection.reason;
|
|
38783
|
+
}
|
|
38784
|
+
}
|
|
38785
|
+
/** Clear all listeners from this BeAsyncEvent.
|
|
38786
|
+
* @note If called during `raiseEvent`, remaining listeners in the current iteration are skipped
|
|
38787
|
+
* immediately rather than being tombstoned.
|
|
38788
|
+
*/
|
|
38789
|
+
clear() { this._listeners.clear(); }
|
|
38790
|
+
}
|
|
38706
38791
|
/**
|
|
38707
38792
|
* A list of BeEvent objects, accessible by an event name.
|
|
38708
38793
|
* This class may be used instead of explicitly declaring each BeEvent as a member of a containing class.
|
|
@@ -41259,16 +41344,18 @@ var Id64;
|
|
|
41259
41344
|
Id64.getFirst = getFirst;
|
|
41260
41345
|
/** Return the number of [[Id64String]]s represented by an [[Id64Arg]]. */
|
|
41261
41346
|
function sizeOf(arg) {
|
|
41262
|
-
return typeof arg === "string" ? 1 :
|
|
41347
|
+
return typeof arg === "string" ? 1 : "size" in arg ? arg.size : arg.length;
|
|
41263
41348
|
}
|
|
41264
41349
|
Id64.sizeOf = sizeOf;
|
|
41265
41350
|
/** Returns true if the [[Id64Arg]] contains the specified Id. */
|
|
41266
41351
|
function has(arg, id) {
|
|
41267
|
-
if (typeof arg === "string")
|
|
41352
|
+
if (typeof arg === "string") {
|
|
41268
41353
|
return arg === id;
|
|
41269
|
-
|
|
41270
|
-
|
|
41271
|
-
|
|
41354
|
+
}
|
|
41355
|
+
if ("has" in arg) {
|
|
41356
|
+
return arg.has(id);
|
|
41357
|
+
}
|
|
41358
|
+
return -1 !== arg.indexOf(id);
|
|
41272
41359
|
}
|
|
41273
41360
|
Id64.has = has;
|
|
41274
41361
|
/** The string representation of an invalid Id. */
|
|
@@ -45338,6 +45425,7 @@ class YieldManager {
|
|
|
45338
45425
|
__webpack_require__.r(__webpack_exports__);
|
|
45339
45426
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
45340
45427
|
/* harmony export */ AbandonedError: () => (/* reexport safe */ _OneAtATimeAction__WEBPACK_IMPORTED_MODULE_22__.AbandonedError),
|
|
45428
|
+
/* harmony export */ BeAsyncEvent: () => (/* reexport safe */ _BeEvent__WEBPACK_IMPORTED_MODULE_2__.BeAsyncEvent),
|
|
45341
45429
|
/* harmony export */ BeDuration: () => (/* reexport safe */ _Time__WEBPACK_IMPORTED_MODULE_30__.BeDuration),
|
|
45342
45430
|
/* harmony export */ BeEvent: () => (/* reexport safe */ _BeEvent__WEBPACK_IMPORTED_MODULE_2__.BeEvent),
|
|
45343
45431
|
/* harmony export */ BeEventList: () => (/* reexport safe */ _BeEvent__WEBPACK_IMPORTED_MODULE_2__.BeEventList),
|
|
@@ -77942,8 +78030,7 @@ class RpcInvocation {
|
|
|
77942
78030
|
return;
|
|
77943
78031
|
for (let i = 0; i !== parameters.length; ++i) {
|
|
77944
78032
|
const parameter = parameters[i];
|
|
77945
|
-
|
|
77946
|
-
if (isToken && this.protocol.checkToken && !this.operation.policy.allowTokenMismatch) {
|
|
78033
|
+
if (this.protocol.checkToken && !this.operation.policy.allowTokenMismatch && RpcInvocation.isTokenParameter(parameter, i)) {
|
|
77947
78034
|
const inflated = this.protocol.inflateToken(parameter, this.request);
|
|
77948
78035
|
parameters[i] = inflated;
|
|
77949
78036
|
if (!RpcInvocation.compareTokens(parameter, inflated)) {
|
|
@@ -77957,9 +78044,20 @@ class RpcInvocation {
|
|
|
77957
78044
|
}
|
|
77958
78045
|
}
|
|
77959
78046
|
}
|
|
78047
|
+
/** Determine whether an operation parameter is an [[IModelRpcProps]]. Every property of the token other than `key` is optional
|
|
78048
|
+
* and all of them are supplied by the caller, so the first parameter is treated as a token if it has *any* of the identifying properties.
|
|
78049
|
+
*/
|
|
78050
|
+
static isTokenParameter(parameter, index) {
|
|
78051
|
+
if (typeof parameter !== "object" || parameter === null || Array.isArray(parameter))
|
|
78052
|
+
return false;
|
|
78053
|
+
const has = (prop) => Object.prototype.hasOwnProperty.call(parameter, prop);
|
|
78054
|
+
if (has("iModelId") && has("iTwinId"))
|
|
78055
|
+
return true;
|
|
78056
|
+
return 0 === index && (has("key") || has("iModelId") || has("iTwinId"));
|
|
78057
|
+
}
|
|
77960
78058
|
static compareTokens(a, b) {
|
|
77961
78059
|
return a.key === b.key &&
|
|
77962
|
-
a.iTwinId === b.iTwinId &&
|
|
78060
|
+
(undefined === a.iTwinId || a.iTwinId === b.iTwinId) &&
|
|
77963
78061
|
a.iModelId === b.iModelId &&
|
|
77964
78062
|
(undefined === a.changeset || (a.changeset.id === b.changeset?.id));
|
|
77965
78063
|
}
|
|
@@ -344187,7 +344285,7 @@ class TestContext {
|
|
|
344187
344285
|
this.initializeRpcInterfaces({ title: this.settings.Backend.name, version: this.settings.Backend.version });
|
|
344188
344286
|
const iModelClient = new imodels_client_management_1.IModelsClient({ api: { baseUrl: `https://${process.env.IMJS_URL_PREFIX ?? ""}api.bentley.com/imodels` } });
|
|
344189
344287
|
await core_frontend_1.NoRenderApp.startup({
|
|
344190
|
-
applicationVersion: "5.15.0-dev.
|
|
344288
|
+
applicationVersion: "5.15.0-dev.14",
|
|
344191
344289
|
applicationId: this.settings.gprid,
|
|
344192
344290
|
authorizationClient: new frontend_1.TestFrontendAuthorizationClient(this.serviceAuthToken),
|
|
344193
344291
|
hubAccess: new imodels_access_frontend_1.FrontendIModelsAccess(iModelClient),
|
|
@@ -370956,7 +371054,7 @@ class WMS {
|
|
|
370956
371054
|
(module) {
|
|
370957
371055
|
|
|
370958
371056
|
"use strict";
|
|
370959
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.15.0-dev.
|
|
371057
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.15.0-dev.14","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.12","@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.4","vitest":"^4.1.10"},"//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"}}');
|
|
370960
371058
|
|
|
370961
371059
|
/***/ },
|
|
370962
371060
|
|