@itwin/presentation-backend 5.0.0-dev.8 → 5.0.0-dev.82
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/CHANGELOG.md +46 -1
- package/lib/cjs/presentation-backend/ElementPropertiesHelper.d.ts +31 -4
- package/lib/cjs/presentation-backend/ElementPropertiesHelper.d.ts.map +1 -1
- package/lib/cjs/presentation-backend/ElementPropertiesHelper.js +161 -57
- package/lib/cjs/presentation-backend/ElementPropertiesHelper.js.map +1 -1
- package/lib/cjs/presentation-backend/NativePlatform.d.ts +2 -2
- package/lib/cjs/presentation-backend/NativePlatform.d.ts.map +1 -1
- package/lib/cjs/presentation-backend/NativePlatform.js +3 -1
- package/lib/cjs/presentation-backend/NativePlatform.js.map +1 -1
- package/lib/cjs/presentation-backend/Presentation.js +19 -15
- package/lib/cjs/presentation-backend/Presentation.js.map +1 -1
- package/lib/cjs/presentation-backend/PresentationIpcHandler.js +1 -4
- package/lib/cjs/presentation-backend/PresentationIpcHandler.js.map +1 -1
- package/lib/cjs/presentation-backend/PresentationManager.d.ts +4 -68
- package/lib/cjs/presentation-backend/PresentationManager.d.ts.map +1 -1
- package/lib/cjs/presentation-backend/PresentationManager.js +56 -103
- package/lib/cjs/presentation-backend/PresentationManager.js.map +1 -1
- package/lib/cjs/presentation-backend/PresentationManagerDetail.d.ts +3 -3
- package/lib/cjs/presentation-backend/PresentationManagerDetail.d.ts.map +1 -1
- package/lib/cjs/presentation-backend/PresentationManagerDetail.js +20 -20
- package/lib/cjs/presentation-backend/PresentationManagerDetail.js.map +1 -1
- package/lib/cjs/presentation-backend/PresentationRpcImpl.d.ts +9 -9
- package/lib/cjs/presentation-backend/PresentationRpcImpl.d.ts.map +1 -1
- package/lib/cjs/presentation-backend/PresentationRpcImpl.js +74 -84
- package/lib/cjs/presentation-backend/PresentationRpcImpl.js.map +1 -1
- package/lib/cjs/presentation-backend/RulesetEmbedder.js +5 -3
- package/lib/cjs/presentation-backend/RulesetEmbedder.js.map +1 -1
- package/lib/cjs/presentation-backend/RulesetManager.js +2 -1
- package/lib/cjs/presentation-backend/RulesetManager.js.map +1 -1
- package/lib/cjs/presentation-backend/RulesetVariablesManager.js +2 -0
- package/lib/cjs/presentation-backend/RulesetVariablesManager.js.map +1 -1
- package/lib/cjs/presentation-backend/SelectionScopesHelper.d.ts +2 -4
- package/lib/cjs/presentation-backend/SelectionScopesHelper.d.ts.map +1 -1
- package/lib/cjs/presentation-backend/SelectionScopesHelper.js +17 -26
- package/lib/cjs/presentation-backend/SelectionScopesHelper.js.map +1 -1
- package/lib/cjs/presentation-backend/TemporaryStorage.d.ts +2 -3
- package/lib/cjs/presentation-backend/TemporaryStorage.d.ts.map +1 -1
- package/lib/cjs/presentation-backend/TemporaryStorage.js +30 -26
- package/lib/cjs/presentation-backend/TemporaryStorage.js.map +1 -1
- package/lib/cjs/presentation-backend/Utils.d.ts.map +1 -1
- package/lib/cjs/presentation-backend/Utils.js +1 -2
- package/lib/cjs/presentation-backend/Utils.js.map +1 -1
- package/package.json +23 -22
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TemporaryStorage.js","sourceRoot":"","sources":["../../../src/presentation-backend/TemporaryStorage.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,sDAA0D;AAC1D,oEAAmF;AAmDnF;;;;;GAKG;AACH,MAAa,gBAAgB;IAK3B;;OAEG;IACH,YAAY,KAA+B;QA0B3C;;;WAGG;QACI,0BAAqB,GAAG,GAAG,EAAE;YAClC,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;YACjC,MAAM,eAAe,GAAa,EAAE,CAAC;YACrC,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;gBAClD,IAAI,IAAI,CAAC,KAAK,CAAC,gBAAgB,KAAK,SAAS,EAAE,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AAC;IAED;;;;;OAKG;IACa,QAAQ,CAAC,EAAU;QACjC,MAAM,aAAa,GAAG,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QACzC,IAAI,aAAa,EAAE,CAAC;YAClB,OAAO,aAAa,CAAC;QACvB,CAAC;QAED,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC,CAAC;QACrE,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;QACzB,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AA3BD,oEA2BC","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/** @packageDocumentation\n * @module Core\n */\n\nimport { assert, IDisposable } from \"@itwin/core-bentley\";\nimport { PresentationError, PresentationStatus } from \"@itwin/presentation-common\";\n\n/**\n * Configuration properties for [[TemporaryStorage]].\n * @internal\n */\nexport interface TemporaryStorageProps<T> {\n /** A method that's called for every value before it's removed from storage */\n cleanupHandler?: (id: string, value: T, reason: \"timeout\" | \"dispose\" | \"request\") => void;\n\n onDisposedSingle?: (id: string) => void;\n onDisposedAll?: () => void;\n\n /**\n * An interval at which the storage attempts to clean up its values.\n * When `0` or `undefined` is specified, values are not cleaned up\n * automatically and cleanup has to be initiated manually by calling\n * [[TemporaryStorage.disposeOutdatedValues]].\n */\n cleanupInterval?: number;\n\n /**\n * Shortest period of time which the value should be kept in storage\n * unused before it's cleaned up.\n *\n * `undefined` means the values may be kept unused in the storage indefinitely.\n * `0` means the values are removed from the storage on every cleanup (either manual\n * call to [[TemporaryStorage.disposeOutdatedValues]] or scheduled (controlled\n * by [[cleanupInterval]])).\n */\n unusedValueLifetime?: number;\n\n /**\n * The maximum period of time which the value should be kept in storage\n * before it's cleaned up. The time is measured from the moment the value is added\n * to the storage.\n *\n * `undefined` means the values may be kept indefinitely. `0` means they're removed\n * up on every cleanup (either manual call to [[TemporaryStorage.disposeOutdatedValues]]\n * or scheduled (controlled by [[cleanupInterval]])).\n */\n maxValueLifetime?: number;\n}\n\n/** Value with know last used time */\ninterface TemporaryValue<T> {\n created: Date;\n lastUsed: Date;\n value: T;\n}\n\n/**\n * Storage for values that get removed from it after being unused (not-requested\n * for a specified amount of time).\n *\n * @internal\n */\nexport class TemporaryStorage<T> implements IDisposable {\n private _timer?: NodeJS.Timeout;\n protected _values: Map<string, TemporaryValue<T>>;\n public readonly props: TemporaryStorageProps<T>;\n\n /**\n * Constructor. Creates the storage using supplied params.\n */\n constructor(props: TemporaryStorageProps<T>) {\n this.props = props;\n this._values = new Map<string, TemporaryValue<T>>();\n if (this.props.cleanupInterval) {\n this._timer = setInterval(this.disposeOutdatedValues, this.props.cleanupInterval);\n }\n }\n\n /**\n * Destructor. Must be called to clean up the stored values\n * and other resources\n */\n public dispose() {\n if (this._timer) {\n clearInterval(this._timer);\n }\n\n if (this.props.cleanupHandler) {\n this._values.forEach((v, id) => {\n this.props.cleanupHandler!(id, v.value, \"dispose\");\n });\n }\n this._values.clear();\n this.props.onDisposedAll && this.props.onDisposedAll();\n }\n\n /**\n * Cleans up values that are currently outdated (based\n * on their max and unused value lifetimes specified through [[Props]]).\n */\n public disposeOutdatedValues = () => {\n const now = new Date().getTime();\n const valuesToDispose: string[] = [];\n for (const [key, entry] of this._values.entries()) {\n if (this.props.maxValueLifetime !== undefined) {\n if (this.props.maxValueLifetime === 0 || now - entry.created.getTime() > this.props.maxValueLifetime) {\n valuesToDispose.push(key);\n continue;\n }\n }\n if (this.props.unusedValueLifetime !== undefined) {\n if (this.props.unusedValueLifetime === 0 || now - entry.lastUsed.getTime() > this.props.unusedValueLifetime) {\n valuesToDispose.push(key);\n continue;\n }\n }\n }\n for (const id of valuesToDispose) {\n this.deleteExistingEntry(id, true);\n }\n };\n\n private deleteExistingEntry(id: string, isTimeout: boolean) {\n assert(this._values.has(id));\n this.props.cleanupHandler && this.props.cleanupHandler(id, this._values.get(id)!.value, isTimeout ? \"timeout\" : \"request\");\n this._values.delete(id);\n this.props.onDisposedSingle && this.props.onDisposedSingle(id);\n }\n\n /**\n * Get a value from the storage.\n *\n * **Note:** requesting a value with this method updates it's last used time.\n */\n public getValue(id: string): T | undefined {\n if (this._values.has(id)) {\n const v = this._values.get(id)!;\n v.lastUsed = new Date();\n return v.value;\n }\n return undefined;\n }\n\n public notifyValueUsed(id: string) {\n const entry = this._values.get(id);\n // istanbul ignore else\n if (entry) {\n entry.lastUsed = new Date();\n }\n }\n\n /**\n * Adds a value into the storage.\n * @throws An error when trying to add a value with ID that's already stored in the storage.\n */\n public addValue(id: string, value: T) {\n if (this._values.has(id)) {\n throw new PresentationError(PresentationStatus.InvalidArgument, `A value with given ID \"${id}\" already exists in this storage.`);\n }\n this._values.set(id, { value, created: new Date(), lastUsed: new Date() });\n }\n\n /** Deletes a value with given id. */\n public deleteValue(id: string) {\n // istanbul ignore else\n if (this._values.has(id)) {\n this.deleteExistingEntry(id, false);\n }\n }\n\n /**\n * Get all values currently in this storage.\n *\n * **Note:** requesting values with this method **doesn't**\n * update their last used times.\n */\n public get values(): T[] {\n const values = new Array<T>();\n for (const v of this._values.values()) {\n values.push(v.value);\n }\n return values;\n }\n}\n\n/**\n * Configuration properties for [[FactoryBasedTemporaryStorage]].\n * @internal\n */\nexport interface FactoryBasedTemporaryStorageProps<T> extends TemporaryStorageProps<T> {\n /** A factory method that creates a stored value given it's identifier */\n factory: (id: string, onValueUsed: () => void) => T;\n}\n\n/**\n * Storage for values that get removed from it after being unused (not-requested\n * for a specified amount of time).\n *\n * @internal\n */\nexport class FactoryBasedTemporaryStorage<T> extends TemporaryStorage<T> {\n public override readonly props: FactoryBasedTemporaryStorageProps<T>;\n\n /**\n * Constructor. Creates the storage using supplied params.\n */\n constructor(props: FactoryBasedTemporaryStorageProps<T>) {\n super(props);\n this.props = props;\n }\n\n /**\n * Get a value from the storage. If the value with the specified id\n * doesn't exist, it gets created.\n *\n * **Note:** requesting a value with this method updates it's last used time.\n */\n public override getValue(id: string): T {\n const existingValue = super.getValue(id);\n if (existingValue) {\n return existingValue;\n }\n\n const value = this.props.factory(id, () => this.notifyValueUsed(id));\n this.addValue(id, value);\n return value;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"TemporaryStorage.js","sourceRoot":"","sources":["../../../src/presentation-backend/TemporaryStorage.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,sDAA6C;AAC7C,oEAAmF;AAmDnF;;;;;GAKG;AACH,MAAa,gBAAgB;IACnB,MAAM,CAAkB;IACtB,OAAO,CAAiC;IAClC,KAAK,CAA2B;IAEhD;;OAEG;IACH,YAAY,KAA+B;QACzC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,OAAO,GAAG,IAAI,GAAG,EAA6B,CAAC;QACpD,IAAI,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE,CAAC;YAC/B,IAAI,CAAC,MAAM,GAAG,WAAW,CAAC,IAAI,CAAC,qBAAqB,EAAE,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;QACpF,CAAC;IACH,CAAC;IAED;;;OAGG;IACI,CAAC,MAAM,CAAC,OAAO,CAAC;QACrB,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC7B,CAAC;QAED,IAAI,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,CAAC;YAC9B,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE;gBAC7B,IAAI,CAAC,KAAK,CAAC,cAAe,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;YACrD,CAAC,CAAC,CAAC;QACL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AE,EAAE,KAAK,CAAC,CAAC;QACzB,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AA3BD,oEA2BC","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/** @packageDocumentation\n * @module Core\n */\n\nimport { assert } from \"@itwin/core-bentley\";\nimport { PresentationError, PresentationStatus } from \"@itwin/presentation-common\";\n\n/**\n * Configuration properties for [[TemporaryStorage]].\n * @internal\n */\nexport interface TemporaryStorageProps<T> {\n /** A method that's called for every value before it's removed from storage */\n cleanupHandler?: (id: string, value: T, reason: \"timeout\" | \"dispose\" | \"request\") => void;\n\n onDisposedSingle?: (id: string) => void;\n onDisposedAll?: () => void;\n\n /**\n * An interval at which the storage attempts to clean up its values.\n * When `0` or `undefined` is specified, values are not cleaned up\n * automatically and cleanup has to be initiated manually by calling\n * [[TemporaryStorage.disposeOutdatedValues]].\n */\n cleanupInterval?: number;\n\n /**\n * Shortest period of time which the value should be kept in storage\n * unused before it's cleaned up.\n *\n * `undefined` means the values may be kept unused in the storage indefinitely.\n * `0` means the values are removed from the storage on every cleanup (either manual\n * call to [[TemporaryStorage.disposeOutdatedValues]] or scheduled (controlled\n * by [[cleanupInterval]])).\n */\n unusedValueLifetime?: number;\n\n /**\n * The maximum period of time which the value should be kept in storage\n * before it's cleaned up. The time is measured from the moment the value is added\n * to the storage.\n *\n * `undefined` means the values may be kept indefinitely. `0` means they're removed\n * up on every cleanup (either manual call to [[TemporaryStorage.disposeOutdatedValues]]\n * or scheduled (controlled by [[cleanupInterval]])).\n */\n maxValueLifetime?: number;\n}\n\n/** Value with know last used time */\ninterface TemporaryValue<T> {\n created: Date;\n lastUsed: Date;\n value: T;\n}\n\n/**\n * Storage for values that get removed from it after being unused (not-requested\n * for a specified amount of time).\n *\n * @internal\n */\nexport class TemporaryStorage<T> implements Disposable {\n private _timer?: NodeJS.Timeout;\n protected _values: Map<string, TemporaryValue<T>>;\n public readonly props: TemporaryStorageProps<T>;\n\n /**\n * Constructor. Creates the storage using supplied params.\n */\n constructor(props: TemporaryStorageProps<T>) {\n this.props = props;\n this._values = new Map<string, TemporaryValue<T>>();\n if (this.props.cleanupInterval) {\n this._timer = setInterval(this.disposeOutdatedValues, this.props.cleanupInterval);\n }\n }\n\n /**\n * Destructor. Must be called to clean up the stored values\n * and other resources\n */\n public [Symbol.dispose]() {\n if (this._timer) {\n clearInterval(this._timer);\n }\n\n if (this.props.cleanupHandler) {\n this._values.forEach((v, id) => {\n this.props.cleanupHandler!(id, v.value, \"dispose\");\n });\n }\n this._values.clear();\n this.props.onDisposedAll && this.props.onDisposedAll();\n }\n\n /**\n * Cleans up values that are currently outdated (based\n * on their max and unused value lifetimes specified through [[Props]]).\n */\n public disposeOutdatedValues = () => {\n const now = new Date().getTime();\n const valuesToDispose: string[] = [];\n for (const [key, entry] of this._values.entries()) {\n if (this.props.maxValueLifetime !== undefined) {\n if (this.props.maxValueLifetime === 0 || now - entry.created.getTime() > this.props.maxValueLifetime) {\n valuesToDispose.push(key);\n continue;\n }\n }\n if (this.props.unusedValueLifetime !== undefined) {\n if (this.props.unusedValueLifetime === 0 || now - entry.lastUsed.getTime() > this.props.unusedValueLifetime) {\n valuesToDispose.push(key);\n continue;\n }\n }\n }\n for (const id of valuesToDispose) {\n this.deleteExistingEntry(id, true);\n }\n };\n\n private deleteExistingEntry(id: string, isTimeout: boolean) {\n assert(this._values.has(id));\n this.props.cleanupHandler && this.props.cleanupHandler(id, this._values.get(id)!.value, isTimeout ? \"timeout\" : \"request\");\n this._values.delete(id);\n this.props.onDisposedSingle && this.props.onDisposedSingle(id);\n }\n\n /**\n * Get a value from the storage.\n *\n * **Note:** requesting a value with this method updates it's last used time.\n */\n public getValue(id: string): T | undefined {\n if (this._values.has(id)) {\n const v = this._values.get(id)!;\n v.lastUsed = new Date();\n return v.value;\n }\n return undefined;\n }\n\n public notifyValueUsed(id: string) {\n const entry = this._values.get(id);\n // istanbul ignore else\n if (entry) {\n entry.lastUsed = new Date();\n }\n }\n\n /**\n * Adds a value into the storage.\n * @throws An error when trying to add a value with ID that's already stored in the storage.\n */\n public addValue(id: string, value: T) {\n if (this._values.has(id)) {\n throw new PresentationError(PresentationStatus.InvalidArgument, `A value with given ID \"${id}\" already exists in this storage.`);\n }\n this._values.set(id, { value, created: new Date(), lastUsed: new Date() });\n }\n\n /** Deletes a value with given id. */\n public deleteValue(id: string) {\n // istanbul ignore else\n if (this._values.has(id)) {\n this.deleteExistingEntry(id, false);\n }\n }\n\n /**\n * Get all values currently in this storage.\n *\n * **Note:** requesting values with this method **doesn't**\n * update their last used times.\n */\n public get values(): T[] {\n const values = new Array<T>();\n for (const v of this._values.values()) {\n values.push(v.value);\n }\n return values;\n }\n}\n\n/**\n * Configuration properties for [[FactoryBasedTemporaryStorage]].\n * @internal\n */\nexport interface FactoryBasedTemporaryStorageProps<T> extends TemporaryStorageProps<T> {\n /** A factory method that creates a stored value given it's identifier */\n factory: (id: string, onValueUsed: () => void) => T;\n}\n\n/**\n * Storage for values that get removed from it after being unused (not-requested\n * for a specified amount of time).\n *\n * @internal\n */\nexport class FactoryBasedTemporaryStorage<T> extends TemporaryStorage<T> {\n public override readonly props: FactoryBasedTemporaryStorageProps<T>;\n\n /**\n * Constructor. Creates the storage using supplied params.\n */\n constructor(props: FactoryBasedTemporaryStorageProps<T>) {\n super(props);\n this.props = props;\n }\n\n /**\n * Get a value from the storage. If the value with the specified id\n * doesn't exist, it gets created.\n *\n * **Note:** requesting a value with this method updates it's last used time.\n */\n public override getValue(id: string): T {\n const existingValue = super.getValue(id);\n if (existingValue) {\n return existingValue;\n }\n\n const value = this.props.factory(id, () => this.notifyValueUsed(id));\n this.addValue(id, value);\n return value;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Utils.d.ts","sourceRoot":"","sources":["../../../src/presentation-backend/Utils.ts"],"names":[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AAE,WAAW,EAAE,OAAO,EAAE,yBAAyB,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,EAAE,QAAQ,QAGrI"}
|
|
@@ -13,7 +13,6 @@ exports.normalizeVersion = normalizeVersion;
|
|
|
13
13
|
exports.combineDiagnosticsOptions = combineDiagnosticsOptions;
|
|
14
14
|
exports.reportDiagnostics = reportDiagnostics;
|
|
15
15
|
const semver_1 = require("semver");
|
|
16
|
-
const core_backend_1 = require("@itwin/core-backend");
|
|
17
16
|
const core_bentley_1 = require("@itwin/core-bentley");
|
|
18
17
|
const presentation_common_1 = require("@itwin/presentation-common");
|
|
19
18
|
const presentation = require("@itwin/presentation-common/lib/cjs/assets/locales/en/Presentation.json"); // eslint-disable-line @typescript-eslint/no-require-imports
|
|
@@ -36,7 +35,7 @@ function getLocalizedStringEN(key) {
|
|
|
36
35
|
/** @internal */
|
|
37
36
|
function getElementKey(imodel, id) {
|
|
38
37
|
let key;
|
|
39
|
-
const query = `SELECT ECClassId FROM
|
|
38
|
+
const query = `SELECT ECClassId FROM BisCore.Element e WHERE ECInstanceId = ?`;
|
|
40
39
|
imodel.withPreparedStatement(query, (stmt) => {
|
|
41
40
|
try {
|
|
42
41
|
stmt.bindId(1, id);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Utils.js","sourceRoot":"","sources":["../../../src/presentation-backend/Utils.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;AAiBH,oDAcC;AAGD,sCAYC;AAGD,4CAQC;AAwCD,8DAuBC;AAGD,8CAGC;AA5HD,mCAA+C;AAC/C,sDAAwD;AACxD,sDAA2D;AAC3D,oEAOoC;AAEpC,MAAM,YAAY,GAAG,OAAO,CAAC,wEAAwE,CAAC,CAAC,CAAC,4DAA4D;AAEpK,gBAAgB;AAChB,SAAgB,oBAAoB,CAAC,GAAW;IAC9C,IAAI,MAAM,GAAG,YAAY,CAAC;IAC1B,MAAM,CAAC,SAAS,EAAE,UAAU,CAA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,OAAO,aAAa,CAAC,QAAQ,CAAC;gBAC9B,OAAO,aAAa,CAAC,oBAAoB,CAAC;gBAC1C,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;YAC/B,CAAC;QACH,CAAC;aAAM,CAAC;YACN,MAAM,kBAAkB,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,IAAI,IAAA,kDAA4B,EAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YACpH,MAAM,qBAAqB,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,IAAI,IAAA,kDAA4B,EAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YAChI,IAAI,kBAAkB,IAAI,qBAAqB,EAAE,CAAC;gBAChD,QAAQ,CAAC,IAAI,CAAC,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC;YAC9B,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAC;IACH,OAAO,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;AACpD,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/** @packageDocumentation\n * @module Core\n */\n\nimport { parse as parseVersion } from \"semver\";\nimport { Element, IModelDb } from \"@itwin/core-backend\";\nimport { DbResult, Id64String } from \"@itwin/core-bentley\";\nimport {\n combineDiagnosticsSeverities,\n compareDiagnosticsSeverities,\n Diagnostics,\n DiagnosticsLogEntry,\n DiagnosticsOptions,\n InstanceKey,\n} from \"@itwin/presentation-common\";\n\nconst presentation = require(\"@itwin/presentation-common/lib/cjs/assets/locales/en/Presentation.json\"); // eslint-disable-line @typescript-eslint/no-require-imports\n\n/** @internal */\nexport function getLocalizedStringEN(key: string) {\n let result = presentation;\n const [namespace, identifier] = key.split(\":\", 2);\n if (namespace !== \"Presentation\") {\n return key;\n }\n const keySteps = identifier.split(\".\");\n for (const keyStep of keySteps) {\n if (keyStep in result === false) {\n return key;\n }\n result = result[keyStep];\n }\n return typeof result === \"string\" ? result : key;\n}\n\n/** @internal */\nexport function getElementKey(imodel: IModelDb, id: Id64String): InstanceKey | undefined {\n let key: InstanceKey | undefined;\n const query = `SELECT ECClassId FROM ${Element.classFullName} e WHERE ECInstanceId = ?`;\n imodel.withPreparedStatement(query, (stmt) => {\n try {\n stmt.bindId(1, id);\n if (stmt.step() === DbResult.BE_SQLITE_ROW) {\n key = { className: stmt.getValue(0).getClassNameForClassId().replace(\".\", \":\"), id };\n }\n } catch {}\n });\n return key;\n}\n\n/** @internal */\nexport function normalizeVersion(version?: string) {\n if (version) {\n const parsedVersion = parseVersion(version, true);\n if (parsedVersion) {\n return `${parsedVersion.major}.${parsedVersion.minor}.${parsedVersion.patch}`;\n }\n }\n return \"0.0.0\";\n}\n\n/**\n * A function that received request diagnostics and, optionally, request context.\n * @public\n */\nexport type BackendDiagnosticsHandler<TContext = any> = (logs: Diagnostics, requestContext?: TContext) => void;\n\n/**\n * Data structure for backend diagnostics options.\n * @public\n */\nexport interface BackendDiagnosticsOptions<TContext = any> extends DiagnosticsOptions {\n /**\n * An optional function to supply request context that'll be passed to [[handler]] when\n * it's called after the request is fulfilled.\n */\n requestContextSupplier?: () => TContext;\n\n /**\n * Request diagnostics handler function that is called after the request is fulfilled. The handler\n * receives request diagnostics as the first argument and, optionally, request context as the\n * second (see [[requestContextSupplier]]).\n */\n handler: BackendDiagnosticsHandler<TContext>;\n}\n\n/**\n * Data structure which contains backend diagnostics options.\n * @public\n */\nexport interface BackendDiagnosticsAttribute {\n /**\n * Backend diagnostics options.\n * @public\n */\n diagnostics?: BackendDiagnosticsOptions;\n}\n\n/** @internal */\nexport function combineDiagnosticsOptions(...options: Array<BackendDiagnosticsOptions | undefined>): DiagnosticsOptions | undefined {\n const combinedOptions: DiagnosticsOptions = {};\n options.forEach((d) => {\n if (!d) {\n return;\n }\n if (\n d.perf === true ||\n (typeof d.perf === \"object\" &&\n (!combinedOptions.perf || (typeof combinedOptions.perf === \"object\" && d.perf.minimumDuration < combinedOptions.perf.minimumDuration)))\n ) {\n combinedOptions.perf = d.perf;\n }\n const combinedDev = combineDiagnosticsSeverities(d.dev, combinedOptions.dev);\n if (combinedDev) {\n combinedOptions.dev = combinedDev;\n }\n const combinedEditor = combineDiagnosticsSeverities(d.editor, combinedOptions.editor);\n if (combinedEditor) {\n combinedOptions.editor = combinedEditor;\n }\n });\n return combinedOptions.dev || combinedOptions.editor || combinedOptions.perf ? combinedOptions : undefined;\n}\n\n/** @internal */\nexport function reportDiagnostics<TContext>(diagnostics: Diagnostics, options: BackendDiagnosticsOptions<TContext>, context?: TContext) {\n const stripped = diagnostics.logs ? stripDiagnostics(options, diagnostics.logs) : undefined;\n stripped && options.handler({ logs: stripped }, context);\n}\nfunction stripDiagnostics<TEntry extends DiagnosticsLogEntry>(options: DiagnosticsOptions, diagnostics: TEntry[]) {\n const stripped: TEntry[] = [];\n diagnostics.forEach((entry) => {\n if (DiagnosticsLogEntry.isScope(entry)) {\n const scopeLogs = stripDiagnostics(options, entry.logs ?? []);\n const strippedScope = { ...entry, logs: scopeLogs };\n if (!strippedScope.logs) {\n delete strippedScope.logs;\n }\n if (entry.duration !== undefined && (options.perf === true || (typeof options.perf === \"object\" && entry.duration >= options.perf.minimumDuration))) {\n stripped.push(strippedScope);\n } else if (scopeLogs) {\n delete strippedScope.duration;\n delete strippedScope.scopeCreateTimestamp;\n stripped.push(strippedScope);\n }\n } else {\n const matchesDevSeverity = entry.severity.dev && compareDiagnosticsSeverities(entry.severity.dev, options.dev) >= 0;\n const matchesEditorSeverity = entry.severity.editor && compareDiagnosticsSeverities(entry.severity.editor, options.editor) >= 0;\n if (matchesDevSeverity || matchesEditorSeverity) {\n stripped.push({ ...entry });\n }\n }\n });\n return stripped.length > 0 ? stripped : undefined;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Utils.js","sourceRoot":"","sources":["../../../src/presentation-backend/Utils.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;AAiBH,oDAcC;AAGD,sCAYC;AAGD,4CAQC;AAwCD,8DAuBC;AAGD,8CAGC;AA5HD,mCAA+C;AAE/C,sDAA2D;AAC3D,oEAOoC;AAEpC,MAAM,YAAY,GAAG,OAAO,CAAC,wEAAwE,CAAC,CAAC,CAAC,4DAA4D;AAEpK,gBAAgB;AAChB,SAAgB,oBAAoB,CAAC,GAAW;IAC9C,IAAI,MAAM,GAAG,YAAY,CAAC;IAC1B,MAAM,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;IAClD,IAAI,SAAS,KAAK,cAAc,EAAE,CAAC;QACjC,OAAO,GAAG,CAAC;IACb,CAAC;IACD,MAAM,QAAQ,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACvC,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,IAAI,OAAO,IAAI,MAAM,KAAK,KAAK,EAAE,CAAC;YAChC,OAAO,GAAG,CAAC;QACb,CAAC;QACD,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC;IACD,OAAO,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC;AACnD,CAAC;AAED,gBAAgB;AAChB,SAAgB,aAAa,CAAC,MAAgB,EAAE,EAAc;IAC5D,IAAI,GAA4B,CAAC;IACjC,MAAM,KAAK,GAAG,gEAAgE,CAAC;IAC/E,MAAM,CAAC,qBAAqB,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE;QAC3C,IAAI,CAAC;YACH,IAAI,CAAC,MAAM,C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*---------------------------------------------------------------------------------------------\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/** @packageDocumentation\n * @module Core\n */\n\nimport { parse as parseVersion } from \"semver\";\nimport { IModelDb } from \"@itwin/core-backend\";\nimport { DbResult, Id64String } from \"@itwin/core-bentley\";\nimport {\n combineDiagnosticsSeverities,\n compareDiagnosticsSeverities,\n Diagnostics,\n DiagnosticsLogEntry,\n DiagnosticsOptions,\n InstanceKey,\n} from \"@itwin/presentation-common\";\n\nconst presentation = require(\"@itwin/presentation-common/lib/cjs/assets/locales/en/Presentation.json\"); // eslint-disable-line @typescript-eslint/no-require-imports\n\n/** @internal */\nexport function getLocalizedStringEN(key: string) {\n let result = presentation;\n const [namespace, identifier] = key.split(\":\", 2);\n if (namespace !== \"Presentation\") {\n return key;\n }\n const keySteps = identifier.split(\".\");\n for (const keyStep of keySteps) {\n if (keyStep in result === false) {\n return key;\n }\n result = result[keyStep];\n }\n return typeof result === \"string\" ? result : key;\n}\n\n/** @internal */\nexport function getElementKey(imodel: IModelDb, id: Id64String): InstanceKey | undefined {\n let key: InstanceKey | undefined;\n const query = `SELECT ECClassId FROM BisCore.Element e WHERE ECInstanceId = ?`;\n imodel.withPreparedStatement(query, (stmt) => {\n try {\n stmt.bindId(1, id);\n if (stmt.step() === DbResult.BE_SQLITE_ROW) {\n key = { className: stmt.getValue(0).getClassNameForClassId().replace(\".\", \":\"), id };\n }\n } catch {}\n });\n return key;\n}\n\n/** @internal */\nexport function normalizeVersion(version?: string) {\n if (version) {\n const parsedVersion = parseVersion(version, true);\n if (parsedVersion) {\n return `${parsedVersion.major}.${parsedVersion.minor}.${parsedVersion.patch}`;\n }\n }\n return \"0.0.0\";\n}\n\n/**\n * A function that received request diagnostics and, optionally, request context.\n * @public\n */\nexport type BackendDiagnosticsHandler<TContext = any> = (logs: Diagnostics, requestContext?: TContext) => void;\n\n/**\n * Data structure for backend diagnostics options.\n * @public\n */\nexport interface BackendDiagnosticsOptions<TContext = any> extends DiagnosticsOptions {\n /**\n * An optional function to supply request context that'll be passed to [[handler]] when\n * it's called after the request is fulfilled.\n */\n requestContextSupplier?: () => TContext;\n\n /**\n * Request diagnostics handler function that is called after the request is fulfilled. The handler\n * receives request diagnostics as the first argument and, optionally, request context as the\n * second (see [[requestContextSupplier]]).\n */\n handler: BackendDiagnosticsHandler<TContext>;\n}\n\n/**\n * Data structure which contains backend diagnostics options.\n * @public\n */\nexport interface BackendDiagnosticsAttribute {\n /**\n * Backend diagnostics options.\n * @public\n */\n diagnostics?: BackendDiagnosticsOptions;\n}\n\n/** @internal */\nexport function combineDiagnosticsOptions(...options: Array<BackendDiagnosticsOptions | undefined>): DiagnosticsOptions | undefined {\n const combinedOptions: DiagnosticsOptions = {};\n options.forEach((d) => {\n if (!d) {\n return;\n }\n if (\n d.perf === true ||\n (typeof d.perf === \"object\" &&\n (!combinedOptions.perf || (typeof combinedOptions.perf === \"object\" && d.perf.minimumDuration < combinedOptions.perf.minimumDuration)))\n ) {\n combinedOptions.perf = d.perf;\n }\n const combinedDev = combineDiagnosticsSeverities(d.dev, combinedOptions.dev);\n if (combinedDev) {\n combinedOptions.dev = combinedDev;\n }\n const combinedEditor = combineDiagnosticsSeverities(d.editor, combinedOptions.editor);\n if (combinedEditor) {\n combinedOptions.editor = combinedEditor;\n }\n });\n return combinedOptions.dev || combinedOptions.editor || combinedOptions.perf ? combinedOptions : undefined;\n}\n\n/** @internal */\nexport function reportDiagnostics<TContext>(diagnostics: Diagnostics, options: BackendDiagnosticsOptions<TContext>, context?: TContext) {\n const stripped = diagnostics.logs ? stripDiagnostics(options, diagnostics.logs) : undefined;\n stripped && options.handler({ logs: stripped }, context);\n}\nfunction stripDiagnostics<TEntry extends DiagnosticsLogEntry>(options: DiagnosticsOptions, diagnostics: TEntry[]) {\n const stripped: TEntry[] = [];\n diagnostics.forEach((entry) => {\n if (DiagnosticsLogEntry.isScope(entry)) {\n const scopeLogs = stripDiagnostics(options, entry.logs ?? []);\n const strippedScope = { ...entry, logs: scopeLogs };\n if (!strippedScope.logs) {\n delete strippedScope.logs;\n }\n if (entry.duration !== undefined && (options.perf === true || (typeof options.perf === \"object\" && entry.duration >= options.perf.minimumDuration))) {\n stripped.push(strippedScope);\n } else if (scopeLogs) {\n delete strippedScope.duration;\n delete strippedScope.scopeCreateTimestamp;\n stripped.push(strippedScope);\n }\n } else {\n const matchesDevSeverity = entry.severity.dev && compareDiagnosticsSeverities(entry.severity.dev, options.dev) >= 0;\n const matchesEditorSeverity = entry.severity.editor && compareDiagnosticsSeverities(entry.severity.editor, options.editor) >= 0;\n if (matchesDevSeverity || matchesEditorSeverity) {\n stripped.push({ ...entry });\n }\n }\n });\n return stripped.length > 0 ? stripped : undefined;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/presentation-backend",
|
|
3
|
-
"version": "5.0.0-dev.
|
|
3
|
+
"version": "5.0.0-dev.82",
|
|
4
4
|
"description": "Backend of iTwin.js Presentation library",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
"main": "lib/cjs/presentation-backend.js",
|
|
24
24
|
"typings": "lib/cjs/presentation-backend",
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"@itwin/core-backend": "
|
|
27
|
-
"@itwin/core-
|
|
28
|
-
"@itwin/core-
|
|
29
|
-
"@itwin/core-
|
|
30
|
-
"@itwin/ecschema-metadata": "
|
|
31
|
-
"@itwin/presentation-common": "
|
|
26
|
+
"@itwin/core-backend": "5.0.0-dev.82",
|
|
27
|
+
"@itwin/core-quantity": "5.0.0-dev.82",
|
|
28
|
+
"@itwin/core-bentley": "5.0.0-dev.82",
|
|
29
|
+
"@itwin/core-common": "5.0.0-dev.82",
|
|
30
|
+
"@itwin/ecschema-metadata": "5.0.0-dev.82",
|
|
31
|
+
"@itwin/presentation-common": "5.0.0-dev.82"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@itwin/eslint-plugin": "5.0.0-dev.1",
|
|
@@ -41,38 +41,39 @@
|
|
|
41
41
|
"@types/faker": "^4.1.0",
|
|
42
42
|
"@types/lolex": "^2.1.2",
|
|
43
43
|
"@types/mocha": "^10.0.6",
|
|
44
|
-
"@types/node": "~20.
|
|
44
|
+
"@types/node": "~20.17.0",
|
|
45
45
|
"@types/object-hash": "^1.3.0",
|
|
46
46
|
"@types/semver": "7.3.10",
|
|
47
47
|
"@types/sinon": "^17.0.2",
|
|
48
48
|
"@types/sinon-chai": "^3.2.0",
|
|
49
49
|
"@types/sinonjs__fake-timers": "^8.1.5",
|
|
50
|
+
"@types/source-map-support": "^0.4.0",
|
|
50
51
|
"chai": "^4.3.10",
|
|
51
52
|
"chai-as-promised": "^7.1.1",
|
|
52
53
|
"chai-jest-snapshot": "^2.0.0",
|
|
53
54
|
"chai-subset": "1.6.0",
|
|
54
|
-
"cpx2": "^
|
|
55
|
-
"cross-env": "^
|
|
55
|
+
"cpx2": "^8.0.0",
|
|
56
|
+
"cross-env": "^7.0.3",
|
|
56
57
|
"deep-equal": "^1",
|
|
57
58
|
"eslint": "^9.13.0",
|
|
58
59
|
"eslint-config-prettier": "^9.1.0",
|
|
59
60
|
"faker": "^4.1.0",
|
|
60
|
-
"mocha": "^
|
|
61
|
-
"nyc": "^
|
|
61
|
+
"mocha": "^11.1.0",
|
|
62
|
+
"nyc": "^17.1.0",
|
|
62
63
|
"prettier": "^3.2.5",
|
|
63
|
-
"rimraf": "^
|
|
64
|
+
"rimraf": "^6.0.1",
|
|
64
65
|
"sinon": "^17.0.2",
|
|
65
66
|
"sinon-chai": "^3.7.0",
|
|
66
67
|
"source-map-support": "^0.5.6",
|
|
67
68
|
"typemoq": "^2.1.0",
|
|
68
69
|
"typescript": "~5.6.2",
|
|
69
|
-
"@itwin/build-tools": "5.0.0-dev.
|
|
70
|
-
"@itwin/core-bentley": "5.0.0-dev.
|
|
71
|
-
"@itwin/core-
|
|
72
|
-
"@itwin/
|
|
73
|
-
"@itwin/core-
|
|
74
|
-
"@itwin/ecschema-metadata": "5.0.0-dev.
|
|
75
|
-
"@itwin/
|
|
70
|
+
"@itwin/build-tools": "5.0.0-dev.82",
|
|
71
|
+
"@itwin/core-bentley": "5.0.0-dev.82",
|
|
72
|
+
"@itwin/core-common": "5.0.0-dev.82",
|
|
73
|
+
"@itwin/presentation-common": "5.0.0-dev.82",
|
|
74
|
+
"@itwin/core-backend": "5.0.0-dev.82",
|
|
75
|
+
"@itwin/ecschema-metadata": "5.0.0-dev.82",
|
|
76
|
+
"@itwin/core-quantity": "5.0.0-dev.82"
|
|
76
77
|
},
|
|
77
78
|
"dependencies": {
|
|
78
79
|
"object-hash": "^1.3.1",
|
|
@@ -87,7 +88,7 @@
|
|
|
87
88
|
"build": "npm run -s build:cjs",
|
|
88
89
|
"build:cjs": "tsc 1>&2",
|
|
89
90
|
"build:watch": "npm run -s build:cjs -- -w",
|
|
90
|
-
"clean": "rimraf lib .rush/temp/package-deps*.json",
|
|
91
|
+
"clean": "rimraf -g lib .rush/temp/package-deps*.json",
|
|
91
92
|
"cover": "nyc npm -s test",
|
|
92
93
|
"docs": "npm run -s docs:reference && npm run -s extract && npm run -s docs:changelog",
|
|
93
94
|
"docs:changelog": "cpx ./CHANGELOG.md ../../generated-docs/presentation/presentation-backend",
|
|
@@ -95,7 +96,7 @@
|
|
|
95
96
|
"extract": "betools extract --fileExt=ts --extractFrom=./src/test --recursive --out=../../generated-docs/extract",
|
|
96
97
|
"extract-api": "betools extract-api --entry=presentation-backend",
|
|
97
98
|
"lint": "eslint \"./src/**/*.ts\" 1>&2",
|
|
98
|
-
"test": "mocha --config
|
|
99
|
+
"test": "mocha --config ./.mocharc.json",
|
|
99
100
|
"test:watch": "npm -s test -- --reporter min --watch-extensions ts --watch",
|
|
100
101
|
"prettier:fix": "prettier --write ."
|
|
101
102
|
}
|