@itwin/presentation-frontend 4.5.0-dev.9 → 4.6.0-dev.0
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/LICENSE.md +1 -1
- package/README.md +1 -1
- package/lib/cjs/presentation-frontend/ConnectivityInformationProvider.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/ConnectivityInformationProvider.js +10 -6
- package/lib/cjs/presentation-frontend/ConnectivityInformationProvider.js.map +1 -1
- package/lib/cjs/presentation-frontend/Diagnostics.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/Diagnostics.js +18 -13
- package/lib/cjs/presentation-frontend/Diagnostics.js.map +1 -1
- package/lib/cjs/presentation-frontend/FrontendLoggerCategory.js +3 -3
- package/lib/cjs/presentation-frontend/FrontendLoggerCategory.js.map +1 -1
- package/lib/cjs/presentation-frontend/IpcRequestsHandler.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/IpcRequestsHandler.js +3 -3
- package/lib/cjs/presentation-frontend/IpcRequestsHandler.js.map +1 -1
- package/lib/cjs/presentation-frontend/LocalizationHelper.js +3 -3
- package/lib/cjs/presentation-frontend/LocalizationHelper.js.map +1 -1
- package/lib/cjs/presentation-frontend/Presentation.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/Presentation.js +26 -16
- package/lib/cjs/presentation-frontend/Presentation.js.map +1 -1
- package/lib/cjs/presentation-frontend/PresentationManager.d.ts +84 -21
- package/lib/cjs/presentation-frontend/PresentationManager.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/PresentationManager.js +245 -154
- package/lib/cjs/presentation-frontend/PresentationManager.js.map +1 -1
- package/lib/cjs/presentation-frontend/RulesetManager.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/RulesetManager.js +11 -7
- package/lib/cjs/presentation-frontend/RulesetManager.js.map +1 -1
- package/lib/cjs/presentation-frontend/RulesetVariablesManager.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/RulesetVariablesManager.js +53 -31
- package/lib/cjs/presentation-frontend/RulesetVariablesManager.js.map +1 -1
- package/lib/cjs/presentation-frontend/StreamedResponseGenerator.d.ts +30 -0
- package/lib/cjs/presentation-frontend/StreamedResponseGenerator.d.ts.map +1 -0
- package/lib/cjs/presentation-frontend/StreamedResponseGenerator.js +117 -0
- package/lib/cjs/presentation-frontend/StreamedResponseGenerator.js.map +1 -0
- package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesManager.d.ts +33 -4
- package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesManager.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesManager.js +179 -74
- package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesManager.js.map +1 -1
- package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesStorage.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesStorage.js +54 -25
- package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesStorage.js.map +1 -1
- package/lib/cjs/presentation-frontend/selection/HiliteRules.json +172 -172
- package/lib/cjs/presentation-frontend/selection/HiliteSetProvider.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/selection/HiliteSetProvider.js +23 -13
- package/lib/cjs/presentation-frontend/selection/HiliteSetProvider.js.map +1 -1
- package/lib/cjs/presentation-frontend/selection/ISelectionProvider.js +3 -3
- package/lib/cjs/presentation-frontend/selection/ISelectionProvider.js.map +1 -1
- package/lib/cjs/presentation-frontend/selection/SelectionChangeEvent.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/selection/SelectionChangeEvent.js +3 -3
- package/lib/cjs/presentation-frontend/selection/SelectionChangeEvent.js.map +1 -1
- package/lib/cjs/presentation-frontend/selection/SelectionHandler.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/selection/SelectionHandler.js +15 -9
- package/lib/cjs/presentation-frontend/selection/SelectionHandler.js.map +1 -1
- package/lib/cjs/presentation-frontend/selection/SelectionHelper.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/selection/SelectionHelper.js +7 -5
- package/lib/cjs/presentation-frontend/selection/SelectionHelper.js.map +1 -1
- package/lib/cjs/presentation-frontend/selection/SelectionManager.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/selection/SelectionManager.js +31 -16
- package/lib/cjs/presentation-frontend/selection/SelectionManager.js.map +1 -1
- package/lib/cjs/presentation-frontend/selection/SelectionScopesManager.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/selection/SelectionScopesManager.js +25 -14
- package/lib/cjs/presentation-frontend/selection/SelectionScopesManager.js.map +1 -1
- package/lib/cjs/presentation-frontend.js +3 -3
- package/lib/cjs/presentation-frontend.js.map +1 -1
- package/lib/esm/presentation-frontend/ConnectivityInformationProvider.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/ConnectivityInformationProvider.js +10 -6
- package/lib/esm/presentation-frontend/ConnectivityInformationProvider.js.map +1 -1
- package/lib/esm/presentation-frontend/Diagnostics.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/Diagnostics.js +18 -13
- package/lib/esm/presentation-frontend/Diagnostics.js.map +1 -1
- package/lib/esm/presentation-frontend/FrontendLoggerCategory.js +3 -3
- package/lib/esm/presentation-frontend/FrontendLoggerCategory.js.map +1 -1
- package/lib/esm/presentation-frontend/IpcRequestsHandler.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/IpcRequestsHandler.js +3 -3
- package/lib/esm/presentation-frontend/IpcRequestsHandler.js.map +1 -1
- package/lib/esm/presentation-frontend/LocalizationHelper.js +3 -3
- package/lib/esm/presentation-frontend/LocalizationHelper.js.map +1 -1
- package/lib/esm/presentation-frontend/Presentation.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/Presentation.js +26 -16
- package/lib/esm/presentation-frontend/Presentation.js.map +1 -1
- package/lib/esm/presentation-frontend/PresentationManager.d.ts +84 -21
- package/lib/esm/presentation-frontend/PresentationManager.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/PresentationManager.js +244 -152
- package/lib/esm/presentation-frontend/PresentationManager.js.map +1 -1
- package/lib/esm/presentation-frontend/RulesetManager.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/RulesetManager.js +11 -7
- package/lib/esm/presentation-frontend/RulesetManager.js.map +1 -1
- package/lib/esm/presentation-frontend/RulesetVariablesManager.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/RulesetVariablesManager.js +53 -31
- package/lib/esm/presentation-frontend/RulesetVariablesManager.js.map +1 -1
- package/lib/esm/presentation-frontend/StreamedResponseGenerator.d.ts +30 -0
- package/lib/esm/presentation-frontend/StreamedResponseGenerator.d.ts.map +1 -0
- package/lib/esm/presentation-frontend/StreamedResponseGenerator.js +113 -0
- package/lib/esm/presentation-frontend/StreamedResponseGenerator.js.map +1 -0
- package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesManager.d.ts +33 -4
- package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesManager.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesManager.js +179 -74
- package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesManager.js.map +1 -1
- package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesStorage.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesStorage.js +54 -25
- package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesStorage.js.map +1 -1
- package/lib/esm/presentation-frontend/selection/HiliteRules.json +172 -172
- package/lib/esm/presentation-frontend/selection/HiliteSetProvider.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/selection/HiliteSetProvider.js +24 -14
- package/lib/esm/presentation-frontend/selection/HiliteSetProvider.js.map +1 -1
- package/lib/esm/presentation-frontend/selection/ISelectionProvider.js +3 -3
- package/lib/esm/presentation-frontend/selection/ISelectionProvider.js.map +1 -1
- package/lib/esm/presentation-frontend/selection/SelectionChangeEvent.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/selection/SelectionChangeEvent.js +3 -3
- package/lib/esm/presentation-frontend/selection/SelectionChangeEvent.js.map +1 -1
- package/lib/esm/presentation-frontend/selection/SelectionHandler.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/selection/SelectionHandler.js +15 -9
- package/lib/esm/presentation-frontend/selection/SelectionHandler.js.map +1 -1
- package/lib/esm/presentation-frontend/selection/SelectionHelper.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/selection/SelectionHelper.js +7 -5
- package/lib/esm/presentation-frontend/selection/SelectionHelper.js.map +1 -1
- package/lib/esm/presentation-frontend/selection/SelectionManager.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/selection/SelectionManager.js +31 -16
- package/lib/esm/presentation-frontend/selection/SelectionManager.js.map +1 -1
- package/lib/esm/presentation-frontend/selection/SelectionScopesManager.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/selection/SelectionScopesManager.js +25 -14
- package/lib/esm/presentation-frontend/selection/SelectionScopesManager.js.map +1 -1
- package/lib/esm/presentation-frontend.js +3 -3
- package/lib/esm/presentation-frontend.js.map +1 -1
- package/package.json +19 -16
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PresentationManager.js","sourceRoot":"","sources":["../../../src/presentation-frontend/PresentationManager.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAmG;AACnG,wDAA2E;AAG3E,oEAQoC;AACpC,6DAA0D;AAC1D,6DAAkE;AAClE,qDAAsE;AACtE,uEAAiG;AACjG,mEAA2E;AAyF3E;;;;;GAKG;AACH,MAAa,mBAAmB;IAwB9B;;;;;;OAMG;IACH,IAAW,gBAAgB;QACzB,OAAO,IAAI,CAAC,yBAAyB,IAAI,yBAAS,CAAC,iBAAiB,CAAC,gBAAgB,CAAC;IACxF,CAAC;IACD,IAAW,gBAAgB,CAAC,KAAgC,IAAI,IAAI,CAAC,yBAAyB,GAAG,KAAK,CAAC,C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AAPW,QAAA,uBAAuB,2BAOlC;AAEF,MAAM,yBAAyB,GAAG,CAAC,IAAY,EAAE,EAAE;IACjD,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,yBAAG,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,SAAS,KAAK,8CAA2B,CAAC;QAC9F,OAAO,IAAI,CAAC;IAEd,MAAM,IAAI,GAAG,IAAI,4BAAM,EAAE,CAAC;IAC1B,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE;QACrB,kFAAkF;QAClF,4EAA4E;QAC5E,uBAAuB;QACvB,MAAM,WAAW,GAAG,yBAAG,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,SAAS,KAAK,8CAA2B;eACtF,yBAAG,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,aAAa,KAAK,8CAA2B,CAAC;QACjF,OAAO,CAAC,WAAW,CAAC;IACtB,CAAC,CAAC,CAAC;IACH,OAAO,IAAI,CAAC;AACd,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Core\r\n */\r\n\r\nimport { BeEvent, CompressedId64Set, IDisposable, OrderedId64Iterable } from \"@itwin/core-bentley\";\r\nimport { IModelApp, IModelConnection, IpcApp } from \"@itwin/core-frontend\";\r\nimport { UnitSystemKey } from \"@itwin/core-quantity\";\r\nimport { SchemaContext } from \"@itwin/ecschema-metadata\";\r\nimport {\r\n ClientDiagnosticsAttribute, Content, ContentDescriptorRequestOptions, ContentFormatter, ContentInstanceKeysRequestOptions,\r\n ContentPropertyValueFormatter, ContentRequestOptions, ContentSourcesRequestOptions, ContentUpdateInfo, Descriptor, DescriptorOverrides,\r\n DisplayLabelRequestOptions, DisplayLabelsRequestOptions, DisplayValueGroup, DistinctValuesRequestOptions, ElementProperties,\r\n FilterByInstancePathsHierarchyRequestOptions, FilterByTextHierarchyRequestOptions, FormatsMap, HierarchyLevelDescriptorRequestOptions,\r\n HierarchyRequestOptions, HierarchyUpdateInfo, InstanceKey, Item, Key, KeySet, KoqPropertyValueFormatter, LabelDefinition, Node, NodeKey,\r\n NodePathElement, Paged, PagedResponse, PageOptions, PresentationIpcEvents, RpcRequestsHandler, Ruleset, RulesetVariable, SelectClassInfo,\r\n SingleElementPropertiesRequestOptions, UpdateInfo, VariableValueTypes,\r\n} from \"@itwin/presentation-common\";\r\nimport { IpcRequestsHandler } from \"./IpcRequestsHandler\";\r\nimport { FrontendLocalizationHelper } from \"./LocalizationHelper\";\r\nimport { RulesetManager, RulesetManagerImpl } from \"./RulesetManager\";\r\nimport { RulesetVariablesManager, RulesetVariablesManagerImpl } from \"./RulesetVariablesManager\";\r\nimport { TRANSIENT_ELEMENT_CLASSNAME } from \"./selection/SelectionManager\";\r\n\r\n/**\r\n * Data structure that describes IModel hierarchy change event arguments.\r\n * @alpha\r\n */\r\nexport interface IModelHierarchyChangeEventArgs {\r\n /** Id of ruleset that was used to create hierarchy. */\r\n rulesetId: string;\r\n /** Hierarchy changes info. */\r\n updateInfo: HierarchyUpdateInfo;\r\n /** Key of iModel that was used to create hierarchy. It matches [[IModelConnection.key]] property. */\r\n imodelKey: string;\r\n}\r\n\r\n/**\r\n * Data structure that describes iModel content change event arguments.\r\n * @alpha\r\n */\r\nexport interface IModelContentChangeEventArgs {\r\n /** Id of ruleset that was used to create content. */\r\n rulesetId: string;\r\n /** Content changes info. */\r\n updateInfo: ContentUpdateInfo;\r\n /** Key of iModel that was used to create content. It matches [[IModelConnection.key]] property. */\r\n imodelKey: string;\r\n}\r\n\r\n/**\r\n * Properties used to configure [[PresentationManager]]\r\n * @public\r\n */\r\nexport interface PresentationManagerProps {\r\n /**\r\n * Sets the active locale to use when localizing presentation-related\r\n * strings. It can later be changed through [[PresentationManager]].\r\n */\r\n activeLocale?: string;\r\n\r\n /**\r\n * Sets the active unit system to use for formatting property values with\r\n * units. The value can later be changed through [[PresentationManager.activeUnitSystem]] setter or\r\n * overriden for each request through request parameters. If not set, `IModelApp.quantityFormatter.activeUnitSystem`\r\n * is used by default.\r\n *\r\n * @deprecated in 4.0. Use [IModelApp.quantityFormatter]($core-frontend) to set the active unit system.\r\n */\r\n activeUnitSystem?: UnitSystemKey;\r\n\r\n /**\r\n * ID used to identify client that requests data. Generally, clients should\r\n * store this ID in their local storage so the ID can be reused across\r\n * sessions - this allows reusing some caches.\r\n *\r\n * Defaults to a unique GUID as a client id.\r\n */\r\n clientId?: string;\r\n\r\n /**\r\n * Timeout (in milliseconds) for how long we're going to wait for RPC request to be fulfilled before throwing\r\n * a timeout error.\r\n *\r\n * Defaults to 10 minutes.\r\n */\r\n requestTimeout?: number;\r\n\r\n /**\r\n * Callback that provides [SchemaContext]($ecschema-metadata) for supplied [IModelConnection]($core-frontend).\r\n * [SchemaContext]($ecschema-metadata) is used for getting metadata required for values formatting.\r\n * @alpha\r\n */\r\n schemaContextProvider?: (imodel: IModelConnection) => SchemaContext;\r\n\r\n /**\r\n * A map of default unit formats to use for formatting properties that don't have a presentation format\r\n * in requested unit system.\r\n *\r\n * @note Only has effect when frontend value formatting is enabled by supplying the `schemaContextProvider` prop.\r\n * @alpha\r\n */\r\n defaultFormats?: FormatsMap;\r\n\r\n /** @internal */\r\n rpcRequestsHandler?: RpcRequestsHandler;\r\n\r\n /** @internal */\r\n ipcRequestsHandler?: IpcRequestsHandler;\r\n}\r\n\r\n/**\r\n * Frontend Presentation manager which basically just forwards all calls to\r\n * the backend implementation.\r\n *\r\n * @public\r\n */\r\nexport class PresentationManager implements IDisposable {\r\n private _requestsHandler: RpcRequestsHandler;\r\n private _rulesets: RulesetManager;\r\n private _localizationHelper: FrontendLocalizationHelper;\r\n private _explicitActiveUnitSystem: UnitSystemKey | undefined;\r\n private _rulesetVars: Map<string, RulesetVariablesManager>;\r\n private _clearEventListener?: () => void;\r\n private _connections: Map<IModelConnection, Promise<void>>;\r\n private _schemaContextProvider?: (imodel: IModelConnection) => SchemaContext;\r\n private _defaultFormats?: FormatsMap;\r\n private _ipcRequestsHandler?: IpcRequestsHandler;\r\n\r\n /**\r\n * An event raised when hierarchies created using specific ruleset change\r\n * @alpha\r\n */\r\n public onIModelHierarchyChanged = new BeEvent<(args: IModelHierarchyChangeEventArgs) => void>();\r\n\r\n /**\r\n * An event raised when content created using specific ruleset changes\r\n * @alpha\r\n */\r\n public onIModelContentChanged = new BeEvent<(args: IModelContentChangeEventArgs) => void>();\r\n\r\n /**\r\n * Get / set active unit system used to format property values with units.\r\n *\r\n * @deprecated in 4.0. `IModelApp.quantityFormatter` should be used to get/set the active unit system. At the moment\r\n * [[PresentationManager]] allows overriding it, but returns `IModelApp.quantityFormatter.activeUnitSystem` if override\r\n * is not set.\r\n */\r\n public get activeUnitSystem(): UnitSystemKey {\r\n return this._explicitActiveUnitSystem ?? IModelApp.quantityFormatter.activeUnitSystem;\r\n }\r\n public set activeUnitSystem(value: UnitSystemKey | undefined) { this._explicitActiveUnitSystem = value; }\r\n\r\n private constructor(props?: PresentationManagerProps) {\r\n if (props) {\r\n // eslint-disable-next-line deprecation/deprecation\r\n this._explicitActiveUnitSystem = props.activeUnitSystem;\r\n }\r\n\r\n this._requestsHandler = props?.rpcRequestsHandler ?? new RpcRequestsHandler(props ? { clientId: props.clientId, timeout: props.requestTimeout } : undefined);\r\n this._rulesetVars = new Map<string, RulesetVariablesManager>();\r\n this._rulesets = RulesetManagerImpl.create();\r\n this._localizationHelper = new FrontendLocalizationHelper(props?.activeLocale);\r\n this._connections = new Map<IModelConnection, Promise<void>>();\r\n this._schemaContextProvider = props?.schemaContextProvider;\r\n this._defaultFormats = props?.defaultFormats;\r\n\r\n if (IpcApp.isValid) {\r\n // Ipc only works in ipc apps, so the `onUpdate` callback will only be called there.\r\n this._clearEventListener = IpcApp.addListener(PresentationIpcEvents.Update, this.onUpdate);\r\n this._ipcRequestsHandler = props?.ipcRequestsHandler ?? new IpcRequestsHandler(this._requestsHandler.clientId);\r\n }\r\n }\r\n\r\n /** Get / set active locale used for localizing presentation data */\r\n public get activeLocale(): string | undefined { return this._localizationHelper.locale; }\r\n public set activeLocale(locale: string | undefined) { this._localizationHelper.locale = locale; }\r\n\r\n public dispose() {\r\n if (this._clearEventListener) {\r\n this._clearEventListener();\r\n this._clearEventListener = undefined;\r\n }\r\n }\r\n\r\n private async onConnection(imodel: IModelConnection) {\r\n if (!this._connections.has(imodel))\r\n this._connections.set(imodel, this.initializeIModel(imodel));\r\n await this._connections.get(imodel);\r\n }\r\n\r\n private async initializeIModel(imodel: IModelConnection) {\r\n imodel.onClose.addOnce(() => {\r\n this._connections.delete(imodel);\r\n });\r\n await this.onNewiModelConnection(imodel);\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n private onUpdate = (_evt: Event, report: UpdateInfo) => {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this.handleUpdateAsync(report);\r\n };\r\n\r\n /** @note This is only called in native apps after changes in iModels */\r\n private async handleUpdateAsync(report: UpdateInfo) {\r\n for (const imodelKey in report) {\r\n // istanbul ignore if\r\n if (!report.hasOwnProperty(imodelKey))\r\n continue;\r\n\r\n const imodelReport = report[imodelKey];\r\n for (const rulesetId in imodelReport) {\r\n // istanbul ignore if\r\n if (!imodelReport.hasOwnProperty(rulesetId))\r\n continue;\r\n\r\n const updateInfo = imodelReport[rulesetId];\r\n if (updateInfo.content)\r\n this.onIModelContentChanged.raiseEvent({ rulesetId, updateInfo: updateInfo.content, imodelKey });\r\n if (updateInfo.hierarchy)\r\n this.onIModelHierarchyChanged.raiseEvent({ rulesetId, updateInfo: updateInfo.hierarchy, imodelKey });\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Function that is called when a new IModelConnection is used to retrieve data.\r\n * @internal\r\n */\r\n public async onNewiModelConnection(_: IModelConnection) { }\r\n\r\n /**\r\n * Create a new PresentationManager instance\r\n * @param props Optional properties used to configure the manager\r\n */\r\n public static create(props?: PresentationManagerProps) {\r\n return new PresentationManager(props);\r\n }\r\n\r\n /** @internal */\r\n public get rpcRequestsHandler() { return this._requestsHandler; }\r\n\r\n /** @internal */\r\n public get ipcRequestsHandler() { return this._ipcRequestsHandler; }\r\n\r\n /**\r\n * Get rulesets manager\r\n */\r\n public rulesets() { return this._rulesets; }\r\n\r\n /**\r\n * Get ruleset variables manager for specific ruleset\r\n * @param rulesetId Id of the ruleset to get the vars manager for\r\n */\r\n public vars(rulesetId: string) {\r\n if (!this._rulesetVars.has(rulesetId)) {\r\n const varsManager = new RulesetVariablesManagerImpl(rulesetId, this._ipcRequestsHandler);\r\n this._rulesetVars.set(rulesetId, varsManager);\r\n }\r\n return this._rulesetVars.get(rulesetId)!;\r\n }\r\n\r\n private toRpcTokenOptions<TOptions extends { imodel: IModelConnection, locale?: string, unitSystem?: UnitSystemKey, rulesetVariables?: RulesetVariable[] }>(requestOptions: TOptions) {\r\n // 1. put default `locale` and `unitSystem`\r\n // 2. put all `requestOptions` members (if `locale` or `unitSystem` are set, they'll override the defaults put at #1)\r\n // 3. put `imodel` of type `IModelRpcProps` which overwrites the `imodel` from `requestOptions` put at #2\r\n const defaultOptions: Pick<TOptions, \"locale\" | \"unitSystem\"> = {};\r\n if (this.activeLocale)\r\n defaultOptions.locale = this.activeLocale;\r\n defaultOptions.unitSystem = this.activeUnitSystem; // eslint-disable-line deprecation/deprecation\r\n\r\n const { imodel, rulesetVariables, ...rpcRequestOptions } = requestOptions;\r\n return {\r\n ...defaultOptions,\r\n ...rpcRequestOptions,\r\n ...(rulesetVariables ? { rulesetVariables: rulesetVariables.map(RulesetVariable.toJSON) } : {}),\r\n imodel: imodel.getRpcProps(),\r\n };\r\n }\r\n\r\n private async addRulesetAndVariablesToOptions<TOptions extends { rulesetOrId: Ruleset | string, rulesetVariables?: RulesetVariable[] }>(options: TOptions) {\r\n const { rulesetOrId, rulesetVariables } = options;\r\n let foundRulesetOrId: Ruleset | string;\r\n if (typeof rulesetOrId === \"object\") {\r\n foundRulesetOrId = rulesetOrId;\r\n } else {\r\n const foundRuleset = await this._rulesets.get(rulesetOrId);\r\n foundRulesetOrId = foundRuleset ? foundRuleset.toJSON() : rulesetOrId;\r\n }\r\n const rulesetId = (typeof foundRulesetOrId === \"object\") ? foundRulesetOrId.id : foundRulesetOrId;\r\n\r\n // All Id64Array variable values must be sorted for serialization to JSON to work. RulesetVariablesManager\r\n // sorts them before storing, so that part is taken care of, but we need to ensure that variables coming from\r\n // request options are also sorted.\r\n const variables = (rulesetVariables ?? []).map((variable) => {\r\n if (variable.type === VariableValueTypes.Id64Array)\r\n return { ...variable, value: OrderedId64Iterable.sortArray(variable.value) };\r\n return variable;\r\n });\r\n if (!this._ipcRequestsHandler) {\r\n // only need to add variables from variables manager if there's no IPC\r\n // handler - if there is one, the variables are already known by the backend\r\n variables.push(...this.vars(rulesetId).getAllVariables());\r\n }\r\n\r\n return { ...options, rulesetOrId: foundRulesetOrId, rulesetVariables: variables };\r\n }\r\n\r\n /** Retrieves nodes */\r\n public async getNodes(requestOptions: Paged<HierarchyRequestOptions<IModelConnection, NodeKey, RulesetVariable>> & ClientDiagnosticsAttribute): Promise<Node[]> {\r\n await this.onConnection(requestOptions.imodel);\r\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\r\n const rpcOptions = this.toRpcTokenOptions({ ...options });\r\n const result = await buildPagedArrayResponse(options.paging, async (partialPageOptions) => this._requestsHandler.getPagedNodes({ ...rpcOptions, paging: partialPageOptions }));\r\n // eslint-disable-next-line deprecation/deprecation\r\n return this._localizationHelper.getLocalizedNodes(result.items.map(Node.fromJSON));\r\n }\r\n\r\n /** Retrieves nodes count. */\r\n public async getNodesCount(requestOptions: HierarchyRequestOptions<IModelConnection, NodeKey, RulesetVariable> & ClientDiagnosticsAttribute): Promise<number> {\r\n await this.onConnection(requestOptions.imodel);\r\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\r\n const rpcOptions = this.toRpcTokenOptions({ ...options });\r\n return this._requestsHandler.getNodesCount(rpcOptions);\r\n }\r\n\r\n /** Retrieves total nodes count and a single page of nodes. */\r\n public async getNodesAndCount(requestOptions: Paged<HierarchyRequestOptions<IModelConnection, NodeKey, RulesetVariable>> & ClientDiagnosticsAttribute): Promise<{ count: number, nodes: Node[] }> {\r\n await this.onConnection(requestOptions.imodel);\r\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\r\n const rpcOptions = this.toRpcTokenOptions({ ...options });\r\n const result = await buildPagedArrayResponse(options.paging, async (partialPageOptions) => this._requestsHandler.getPagedNodes({ ...rpcOptions, paging: partialPageOptions }));\r\n return {\r\n count: result.total,\r\n // eslint-disable-next-line deprecation/deprecation\r\n nodes: this._localizationHelper.getLocalizedNodes(result.items.map(Node.fromJSON)),\r\n };\r\n }\r\n\r\n /**\r\n * Retrieves hierarchy level descriptor.\r\n * @beta\r\n */\r\n public async getNodesDescriptor(requestOptions: HierarchyLevelDescriptorRequestOptions<IModelConnection, NodeKey, RulesetVariable> & ClientDiagnosticsAttribute): Promise<Descriptor | undefined> {\r\n await this.onConnection(requestOptions.imodel);\r\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\r\n const rpcOptions = this.toRpcTokenOptions({ ...options });\r\n const result = await this._requestsHandler.getNodesDescriptor(rpcOptions);\r\n const descriptor = Descriptor.fromJSON(result);\r\n return descriptor ? this._localizationHelper.getLocalizedContentDescriptor(descriptor) : undefined;\r\n }\r\n\r\n /** Retrieves paths from root nodes to children nodes according to specified keys. Intersecting paths will be merged. */\r\n public async getNodePaths(requestOptions: FilterByInstancePathsHierarchyRequestOptions<IModelConnection, RulesetVariable> & ClientDiagnosticsAttribute): Promise<NodePathElement[]> {\r\n await this.onConnection(requestOptions.imodel);\r\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\r\n const rpcOptions = this.toRpcTokenOptions({ ...options });\r\n const result = await this._requestsHandler.getNodePaths(rpcOptions);\r\n // eslint-disable-next-line deprecation/deprecation\r\n return result.map(NodePathElement.fromJSON).map((npe) => this._localizationHelper.getLocalizedNodePathElement(npe));\r\n }\r\n\r\n /** Retrieves paths from root nodes to nodes containing filter text in their label. */\r\n public async getFilteredNodePaths(requestOptions: FilterByTextHierarchyRequestOptions<IModelConnection, RulesetVariable> & ClientDiagnosticsAttribute): Promise<NodePathElement[]> {\r\n await this.onConnection(requestOptions.imodel);\r\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\r\n const result = await this._requestsHandler.getFilteredNodePaths(this.toRpcTokenOptions(options));\r\n // eslint-disable-next-line deprecation/deprecation\r\n return result.map(NodePathElement.fromJSON).map((npe) => this._localizationHelper.getLocalizedNodePathElement(npe));\r\n }\r\n\r\n /**\r\n * Get information about the sources of content when building it for specific ECClasses. Sources involve classes of the primary select instance,\r\n * its related instances for loading related and navigation properties.\r\n * @public\r\n */\r\n public async getContentSources(requestOptions: ContentSourcesRequestOptions<IModelConnection> & ClientDiagnosticsAttribute): Promise<SelectClassInfo[]> {\r\n await this.onConnection(requestOptions.imodel);\r\n const rpcOptions = this.toRpcTokenOptions(requestOptions);\r\n const result = await this._requestsHandler.getContentSources(rpcOptions);\r\n return SelectClassInfo.listFromCompressedJSON(result.sources, result.classesMap);\r\n }\r\n\r\n /** Retrieves the content descriptor which describes the content and can be used to customize it. */\r\n public async getContentDescriptor(requestOptions: ContentDescriptorRequestOptions<IModelConnection, KeySet, RulesetVariable> & ClientDiagnosticsAttribute): Promise<Descriptor | undefined> {\r\n await this.onConnection(requestOptions.imodel);\r\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\r\n const rpcOptions = this.toRpcTokenOptions({\r\n ...options,\r\n keys: stripTransientElementKeys(options.keys).toJSON(),\r\n });\r\n const result = await this._requestsHandler.getContentDescriptor(rpcOptions);\r\n const descriptor = Descriptor.fromJSON(result);\r\n return descriptor ? this._localizationHelper.getLocalizedContentDescriptor(descriptor) : undefined;\r\n }\r\n\r\n /** Retrieves overall content set size. */\r\n public async getContentSetSize(requestOptions: ContentRequestOptions<IModelConnection, Descriptor | DescriptorOverrides, KeySet, RulesetVariable> & ClientDiagnosticsAttribute): Promise<number> {\r\n await this.onConnection(requestOptions.imodel);\r\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\r\n const rpcOptions = this.toRpcTokenOptions({\r\n ...options,\r\n descriptor: getDescriptorOverrides(requestOptions.descriptor),\r\n keys: stripTransientElementKeys(requestOptions.keys).toJSON(),\r\n });\r\n return this._requestsHandler.getContentSetSize(rpcOptions);\r\n }\r\n\r\n /** Retrieves content which consists of a content descriptor and a page of records. */\r\n public async getContent(requestOptions: Paged<ContentRequestOptions<IModelConnection, Descriptor | DescriptorOverrides, KeySet, RulesetVariable>> & ClientDiagnosticsAttribute): Promise<Content | undefined> {\r\n return (await this.getContentAndSize(requestOptions))?.content;\r\n }\r\n\r\n /** Retrieves content set size and content which consists of a content descriptor and a page of records. */\r\n public async getContentAndSize(requestOptions: Paged<ContentRequestOptions<IModelConnection, Descriptor | DescriptorOverrides, KeySet, RulesetVariable>> & ClientDiagnosticsAttribute): Promise<{ content: Content, size: number } | undefined> {\r\n await this.onConnection(requestOptions.imodel);\r\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\r\n const rpcOptions = this.toRpcTokenOptions({\r\n ...options,\r\n descriptor: getDescriptorOverrides(requestOptions.descriptor),\r\n keys: stripTransientElementKeys(requestOptions.keys).toJSON(),\r\n ...(!requestOptions.omitFormattedValues && this._schemaContextProvider !== undefined ? { omitFormattedValues: true } : undefined),\r\n });\r\n let descriptor = (requestOptions.descriptor instanceof Descriptor) ? requestOptions.descriptor : undefined;\r\n const result = await buildPagedArrayResponse(options.paging, async (partialPageOptions, requestIndex) => {\r\n if (0 === requestIndex && !descriptor) {\r\n const content = await this._requestsHandler.getPagedContent({ ...rpcOptions, paging: partialPageOptions });\r\n if (content) {\r\n descriptor = Descriptor.fromJSON(content.descriptor);\r\n return content.contentSet;\r\n }\r\n return { total: 0, items: [] };\r\n }\r\n return this._requestsHandler.getPagedContentSet({ ...rpcOptions, paging: partialPageOptions });\r\n });\r\n if (!descriptor)\r\n return undefined;\r\n\r\n const items = result.items.map((itemJson) => Item.fromJSON(itemJson)).filter<Item>((item): item is Item => (item !== undefined));\r\n const resultContent = new Content(descriptor, items);\r\n if (!requestOptions.omitFormattedValues && this._schemaContextProvider) {\r\n const koqPropertyFormatter = new KoqPropertyValueFormatter(this._schemaContextProvider(requestOptions.imodel), this._defaultFormats);\r\n const contentFormatter = new ContentFormatter(\r\n new ContentPropertyValueFormatter(koqPropertyFormatter),\r\n requestOptions.unitSystem ?? this._explicitActiveUnitSystem ?? IModelApp.quantityFormatter.activeUnitSystem,\r\n );\r\n await contentFormatter.formatContent(resultContent);\r\n }\r\n\r\n return {\r\n size: result.total,\r\n content: this._localizationHelper.getLocalizedContent(resultContent),\r\n };\r\n }\r\n\r\n /** Retrieves distinct values of specific field from the content. */\r\n public async getPagedDistinctValues(requestOptions: DistinctValuesRequestOptions<IModelConnection, Descriptor | DescriptorOverrides, KeySet, RulesetVariable> & ClientDiagnosticsAttribute): Promise<PagedResponse<DisplayValueGroup>> {\r\n await this.onConnection(requestOptions.imodel);\r\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\r\n const rpcOptions = {\r\n ...this.toRpcTokenOptions(options),\r\n descriptor: getDescriptorOverrides(options.descriptor),\r\n keys: stripTransientElementKeys(options.keys).toJSON(),\r\n };\r\n const result = await buildPagedArrayResponse(requestOptions.paging, async (partialPageOptions) => this._requestsHandler.getPagedDistinctValues({ ...rpcOptions, paging: partialPageOptions }));\r\n return {\r\n ...result,\r\n // eslint-disable-next-line deprecation/deprecation\r\n items: result.items.map(DisplayValueGroup.fromJSON).map((g) => this._localizationHelper.getLocalizedDisplayValueGroup(g)),\r\n };\r\n }\r\n\r\n /**\r\n * Retrieves property data in a simplified format for a single element specified by ID.\r\n * @public\r\n */\r\n public async getElementProperties(requestOptions: SingleElementPropertiesRequestOptions<IModelConnection> & ClientDiagnosticsAttribute): Promise<ElementProperties | undefined> {\r\n await this.onConnection(requestOptions.imodel);\r\n const results = await this._requestsHandler.getElementProperties(this.toRpcTokenOptions(requestOptions));\r\n // istanbul ignore if\r\n if (!results)\r\n return undefined;\r\n return this._localizationHelper.getLocalizedElementProperties(results);\r\n }\r\n\r\n /**\r\n * Retrieves content item instance keys.\r\n * @public\r\n */\r\n public async getContentInstanceKeys(requestOptions: ContentInstanceKeysRequestOptions<IModelConnection, KeySet, RulesetVariable> & ClientDiagnosticsAttribute): Promise<{ total: number, items: () => AsyncGenerator<InstanceKey> }> {\r\n await this.onConnection(requestOptions.imodel);\r\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\r\n const rpcOptions = {\r\n ...this.toRpcTokenOptions(options),\r\n keys: stripTransientElementKeys(options.keys).toJSON(),\r\n };\r\n\r\n const props = {\r\n page: requestOptions.paging,\r\n get: async (page: Required<PageOptions>) => {\r\n const keys = await this._requestsHandler.getContentInstanceKeys({ ...rpcOptions, paging: page });\r\n return {\r\n total: keys.total,\r\n items: keys.items.instanceKeys.reduce((instanceKeys, entry) => {\r\n for (const id of CompressedId64Set.iterable(entry[1])) {\r\n instanceKeys.push({ className: entry[0], id });\r\n }\r\n return instanceKeys;\r\n }, new Array<InstanceKey>()),\r\n };\r\n },\r\n };\r\n return createPagedGeneratorResponse(props);\r\n }\r\n\r\n /** Retrieves display label definition of specific item. */\r\n public async getDisplayLabelDefinition(requestOptions: DisplayLabelRequestOptions<IModelConnection, InstanceKey> & ClientDiagnosticsAttribute): Promise<LabelDefinition> {\r\n await this.onConnection(requestOptions.imodel);\r\n const rpcOptions = this.toRpcTokenOptions({ ...requestOptions });\r\n const result = await this._requestsHandler.getDisplayLabelDefinition(rpcOptions);\r\n return this._localizationHelper.getLocalizedLabelDefinition(result);\r\n }\r\n\r\n /** Retrieves display label definition of specific items. */\r\n public async getDisplayLabelDefinitions(requestOptions: DisplayLabelsRequestOptions<IModelConnection, InstanceKey> & ClientDiagnosticsAttribute): Promise<LabelDefinition[]> {\r\n await this.onConnection(requestOptions.imodel);\r\n const rpcOptions = this.toRpcTokenOptions({ ...requestOptions });\r\n const result = await buildPagedArrayResponse(undefined, async (partialPageOptions) => {\r\n const partialKeys = (!partialPageOptions.start) ? rpcOptions.keys : rpcOptions.keys.slice(partialPageOptions.start);\r\n return this._requestsHandler.getPagedDisplayLabelDefinitions({ ...rpcOptions, keys: partialKeys });\r\n });\r\n return this._localizationHelper.getLocalizedLabelDefinitions(result.items);\r\n }\r\n\r\n}\r\n\r\nconst getDescriptorOverrides = (descriptorOrOverrides: Descriptor | DescriptorOverrides): DescriptorOverrides => {\r\n if (descriptorOrOverrides instanceof Descriptor)\r\n return descriptorOrOverrides.createDescriptorOverrides();\r\n return descriptorOrOverrides;\r\n};\r\n\r\ninterface PagedGeneratorCreateProps<TPagedResponseItem> {\r\n page: PageOptions | undefined;\r\n get: (pageStart: Required<PageOptions>, requestIndex: number) => Promise<{ total: number, items: TPagedResponseItem[] }>;\r\n}\r\nasync function createPagedGeneratorResponse<TPagedResponseItem>(props: PagedGeneratorCreateProps<TPagedResponseItem>) {\r\n let pageStart = props.page?.start ?? 0;\r\n let pageSize = props.page?.size ?? 0;\r\n let requestIndex = 0;\r\n\r\n const firstPage = await props.get({ start: pageStart, size: pageSize }, requestIndex++);\r\n return {\r\n total: firstPage.total,\r\n async *items() {\r\n let partialResult = firstPage;\r\n while (true) {\r\n for (const item of partialResult.items) {\r\n yield item;\r\n }\r\n\r\n const receivedItemsCount = partialResult.items.length;\r\n if (partialResult.total !== 0 && receivedItemsCount === 0) {\r\n if (pageStart >= partialResult.total)\r\n throw new Error(`Requested page with start index ${pageStart} is out of bounds. Total number of items: ${partialResult.total}`);\r\n throw new Error(\"Paged request returned non zero total count but no items\");\r\n }\r\n\r\n if (pageSize !== 0 && receivedItemsCount >= pageSize || receivedItemsCount >= (partialResult.total - pageStart))\r\n break;\r\n\r\n if (pageSize !== 0)\r\n pageSize -= receivedItemsCount;\r\n pageStart += receivedItemsCount;\r\n\r\n partialResult = await props.get({ start: pageStart, size: pageSize }, requestIndex++);\r\n }\r\n },\r\n };\r\n}\r\n\r\n/** @internal */\r\nexport const buildPagedArrayResponse = async <TItem>(requestedPage: PageOptions | undefined, getter: (page: Required<PageOptions>, requestIndex: number) => Promise<PagedResponse<TItem>>): Promise<PagedResponse<TItem>> => {\r\n const items = new Array<TItem>();\r\n const gen = await createPagedGeneratorResponse({ page: requestedPage, get: getter });\r\n for await (const item of gen.items()) {\r\n items.push(item);\r\n }\r\n return { total: gen.total, items };\r\n};\r\n\r\nconst stripTransientElementKeys = (keys: KeySet) => {\r\n if (!keys.some((key) => Key.isInstanceKey(key) && key.className === TRANSIENT_ELEMENT_CLASSNAME))\r\n return keys;\r\n\r\n const copy = new KeySet();\r\n copy.add(keys, (key) => {\r\n // the callback is not going to be called with EntityProps as KeySet converts them\r\n // to InstanceKeys, but we want to keep the EntityProps case for correctness\r\n // istanbul ignore next\r\n const isTransient = Key.isInstanceKey(key) && key.className === TRANSIENT_ELEMENT_CLASSNAME\r\n || Key.isEntityProps(key) && key.classFullName === TRANSIENT_ELEMENT_CLASSNAME;\r\n return !isTransient;\r\n });\r\n return copy;\r\n};\r\n"]}
|
|
1
|
+
{"version":3,"file":"PresentationManager.js","sourceRoot":"","sources":["../../../src/presentation-frontend/PresentationManager.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,sDAAmG;AACnG,wDAA2E;AAG3E,oEA4CoC;AACpC,6DAA0D;AAC1D,6DAAkE;AAClE,qDAAsE;AACtE,uEAAiG;AACjG,mEAA2E;AAC3E,2EAAwE;AAqHxE;;;;;GAKG;AACH,MAAa,mBAAmB;IAuB9B;;;;;;OAMG;IACH,IAAW,gBAAgB;QACzB,OAAO,IAAI,CAAC,yBAAyB,IAAI,yBAAS,CAAC,iBAAiB,CAAC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GAAG,IAAI,4BAAM,EAAE,CAAC;IAC1B,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE;QACrB,kFAAkF;QAClF,4EAA4E;QAC5E,uBAAuB;QACvB,MAAM,WAAW,GACf,CAAC,yBAAG,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,SAAS,KAAK,8CAA2B,CAAC;YACzE,CAAC,yBAAG,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,aAAa,KAAK,8CAA2B,CAAC,CAAC;QAChF,OAAO,CAAC,WAAW,CAAC;IACtB,CAAC,CAAC,CAAC;IACH,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,KAAK,UAAU,OAAO,CAAI,IAAsB;IAC9C,MAAM,MAAM,GAAG,IAAI,KAAK,EAAK,CAAC;IAC9B,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,IAAI,EAAE;QAC9B,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KACpB;IACD,OAAO,MAAM,CAAC;AAChB,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 { BeEvent, CompressedId64Set, IDisposable, OrderedId64Iterable } from \"@itwin/core-bentley\";\nimport { IModelApp, IModelConnection, IpcApp } from \"@itwin/core-frontend\";\nimport { UnitSystemKey } from \"@itwin/core-quantity\";\nimport { SchemaContext } from \"@itwin/ecschema-metadata\";\nimport {\n ClientDiagnosticsAttribute,\n Content,\n ContentDescriptorRequestOptions,\n ContentFormatter,\n ContentInstanceKeysRequestOptions,\n ContentPropertyValueFormatter,\n ContentRequestOptions,\n ContentSourcesRequestOptions,\n ContentUpdateInfo,\n Descriptor,\n DescriptorOverrides,\n DisplayLabelRequestOptions,\n DisplayLabelsRequestOptions,\n DisplayValueGroup,\n DistinctValuesRequestOptions,\n ElementProperties,\n FilterByInstancePathsHierarchyRequestOptions,\n FilterByTextHierarchyRequestOptions,\n FormatsMap,\n HierarchyLevelDescriptorRequestOptions,\n HierarchyRequestOptions,\n HierarchyUpdateInfo,\n InstanceKey,\n Item,\n ItemJSON,\n Key,\n KeySet,\n KoqPropertyValueFormatter,\n LabelDefinition,\n Node,\n NodeKey,\n NodePathElement,\n Paged,\n PagedResponse,\n PageOptions,\n PresentationIpcEvents,\n RpcRequestsHandler,\n Ruleset,\n RulesetVariable,\n SelectClassInfo,\n SingleElementPropertiesRequestOptions,\n UpdateInfo,\n VariableValueTypes,\n} from \"@itwin/presentation-common\";\nimport { IpcRequestsHandler } from \"./IpcRequestsHandler\";\nimport { FrontendLocalizationHelper } from \"./LocalizationHelper\";\nimport { RulesetManager, RulesetManagerImpl } from \"./RulesetManager\";\nimport { RulesetVariablesManager, RulesetVariablesManagerImpl } from \"./RulesetVariablesManager\";\nimport { TRANSIENT_ELEMENT_CLASSNAME } from \"./selection/SelectionManager\";\nimport { StreamedResponseGenerator } from \"./StreamedResponseGenerator\";\n\n/**\n * Data structure that describes IModel hierarchy change event arguments.\n * @alpha\n */\nexport interface IModelHierarchyChangeEventArgs {\n /** Id of ruleset that was used to create hierarchy. */\n rulesetId: string;\n /** Hierarchy changes info. */\n updateInfo: HierarchyUpdateInfo;\n /** Key of iModel that was used to create hierarchy. It matches [[IModelConnection.key]] property. */\n imodelKey: string;\n}\n\n/**\n * Data structure that describes iModel content change event arguments.\n * @alpha\n */\nexport interface IModelContentChangeEventArgs {\n /** Id of ruleset that was used to create content. */\n rulesetId: string;\n /** Content changes info. */\n updateInfo: ContentUpdateInfo;\n /** Key of iModel that was used to create content. It matches [[IModelConnection.key]] property. */\n imodelKey: string;\n}\n\n/**\n * Options for requests that can return multiple pages of items concurrently.\n * @public\n */\nexport type MultipleValuesRequestOptions = Paged<{\n maxParallelRequests?: number;\n}>;\n\n/**\n * Options for requests that retrieve nodes.\n * @public\n */\nexport type GetNodesRequestOptions = HierarchyRequestOptions<IModelConnection, NodeKey, RulesetVariable> & ClientDiagnosticsAttribute;\n\n/**\n * Options for requests that retrieve content.\n * @public\n */\nexport type GetContentRequestOptions = ContentRequestOptions<IModelConnection, Descriptor | DescriptorOverrides, KeySet, RulesetVariable> &\n ClientDiagnosticsAttribute;\n\n/**\n * Options for requests that retrieve distinct values.\n * @public\n */\nexport type GetDistinctValuesRequestOptions = DistinctValuesRequestOptions<IModelConnection, Descriptor | DescriptorOverrides, KeySet, RulesetVariable> &\n ClientDiagnosticsAttribute;\n\n/**\n * Properties used to configure [[PresentationManager]]\n * @public\n */\nexport interface PresentationManagerProps {\n /**\n * Sets the active locale to use when localizing presentation-related\n * strings. It can later be changed through [[PresentationManager]].\n */\n activeLocale?: string;\n\n /**\n * Sets the active unit system to use for formatting property values with\n * units. The value can later be changed through [[PresentationManager.activeUnitSystem]] setter or\n * overriden for each request through request parameters. If not set, `IModelApp.quantityFormatter.activeUnitSystem`\n * is used by default.\n *\n * @deprecated in 4.0. Use [IModelApp.quantityFormatter]($core-frontend) to set the active unit system.\n */\n activeUnitSystem?: UnitSystemKey;\n\n /**\n * ID used to identify client that requests data. Generally, clients should\n * store this ID in their local storage so the ID can be reused across\n * sessions - this allows reusing some caches.\n *\n * Defaults to a unique GUID as a client id.\n */\n clientId?: string;\n\n /**\n * Timeout (in milliseconds) for how long we're going to wait for RPC request to be fulfilled before throwing\n * a timeout error.\n *\n * Defaults to 10 minutes.\n */\n requestTimeout?: number;\n\n /**\n * Callback that provides [SchemaContext]($ecschema-metadata) for supplied [IModelConnection]($core-frontend).\n * [SchemaContext]($ecschema-metadata) is used for getting metadata required for values formatting.\n * @alpha\n */\n schemaContextProvider?: (imodel: IModelConnection) => SchemaContext;\n\n /**\n * A map of default unit formats to use for formatting properties that don't have a presentation format\n * in requested unit system.\n *\n * @note Only has effect when frontend value formatting is enabled by supplying the `schemaContextProvider` prop.\n * @alpha\n */\n defaultFormats?: FormatsMap;\n\n /** @internal */\n rpcRequestsHandler?: RpcRequestsHandler;\n\n /** @internal */\n ipcRequestsHandler?: IpcRequestsHandler;\n}\n\n/**\n * Frontend Presentation manager which basically just forwards all calls to\n * the backend implementation.\n *\n * @public\n */\nexport class PresentationManager implements IDisposable {\n private _requestsHandler: RpcRequestsHandler;\n private _rulesets: RulesetManager;\n private _localizationHelper: FrontendLocalizationHelper;\n private _explicitActiveUnitSystem: UnitSystemKey | undefined;\n private _rulesetVars: Map<string, RulesetVariablesManager>;\n private _clearEventListener?: () => void;\n private _schemaContextProvider?: (imodel: IModelConnection) => SchemaContext;\n private _defaultFormats?: FormatsMap;\n private _ipcRequestsHandler?: IpcRequestsHandler;\n\n /**\n * An event raised when hierarchies created using specific ruleset change\n * @alpha\n */\n public onIModelHierarchyChanged = new BeEvent<(args: IModelHierarchyChangeEventArgs) => void>();\n\n /**\n * An event raised when content created using specific ruleset changes\n * @alpha\n */\n public onIModelContentChanged = new BeEvent<(args: IModelContentChangeEventArgs) => void>();\n\n /**\n * Get / set active unit system used to format property values with units.\n *\n * @deprecated in 4.0. `IModelApp.quantityFormatter` should be used to get/set the active unit system. At the moment\n * [[PresentationManager]] allows overriding it, but returns `IModelApp.quantityFormatter.activeUnitSystem` if override\n * is not set.\n */\n public get activeUnitSystem(): UnitSystemKey {\n return this._explicitActiveUnitSystem ?? IModelApp.quantityFormatter.activeUnitSystem;\n }\n public set activeUnitSystem(value: UnitSystemKey | undefined) {\n this._explicitActiveUnitSystem = value;\n }\n\n private constructor(props?: PresentationManagerProps) {\n if (props) {\n // eslint-disable-next-line deprecation/deprecation\n this._explicitActiveUnitSystem = props.activeUnitSystem;\n }\n\n this._requestsHandler =\n props?.rpcRequestsHandler ?? new RpcRequestsHandler(props ? { clientId: props.clientId, timeout: props.requestTimeout } : undefined);\n this._rulesetVars = new Map<string, RulesetVariablesManager>();\n this._rulesets = RulesetManagerImpl.create();\n this._localizationHelper = new FrontendLocalizationHelper(props?.activeLocale);\n this._schemaContextProvider = props?.schemaContextProvider;\n this._defaultFormats = props?.defaultFormats;\n\n if (IpcApp.isValid) {\n // Ipc only works in ipc apps, so the `onUpdate` callback will only be called there.\n this._clearEventListener = IpcApp.addListener(PresentationIpcEvents.Update, this.onUpdate);\n this._ipcRequestsHandler = props?.ipcRequestsHandler ?? new IpcRequestsHandler(this._requestsHandler.clientId);\n }\n }\n\n /** Get / set active locale used for localizing presentation data */\n public get activeLocale(): string | undefined {\n return this._localizationHelper.locale;\n }\n public set activeLocale(locale: string | undefined) {\n this._localizationHelper.locale = locale;\n }\n\n public dispose() {\n if (this._clearEventListener) {\n this._clearEventListener();\n this._clearEventListener = undefined;\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/naming-convention\n private onUpdate = (_evt: Event, report: UpdateInfo) => {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.handleUpdateAsync(report);\n };\n\n /** @note This is only called in native apps after changes in iModels */\n private async handleUpdateAsync(report: UpdateInfo) {\n for (const imodelKey in report) {\n // istanbul ignore if\n if (!report.hasOwnProperty(imodelKey)) {\n continue;\n }\n\n const imodelReport = report[imodelKey];\n for (const rulesetId in imodelReport) {\n // istanbul ignore if\n if (!imodelReport.hasOwnProperty(rulesetId)) {\n continue;\n }\n\n const updateInfo = imodelReport[rulesetId];\n if (updateInfo.content) {\n this.onIModelContentChanged.raiseEvent({ rulesetId, updateInfo: updateInfo.content, imodelKey });\n }\n if (updateInfo.hierarchy) {\n this.onIModelHierarchyChanged.raiseEvent({ rulesetId, updateInfo: updateInfo.hierarchy, imodelKey });\n }\n }\n }\n }\n\n /**\n * Function that is called when a new IModelConnection is used to retrieve data.\n * @internal\n */\n public startIModelInitialization(_: IModelConnection) {}\n\n /**\n * Function that should be called to finish initialization that was started at [[PresentationManager.startIModelInitialization]].\n * Can be removed when [[FavoritePropertiesManager.has]] and [[FavoritePropertiesManager.sortFields]] are removed.\n * @internal\n */\n public async ensureIModelInitialized(_: IModelConnection) {}\n\n /**\n * Create a new PresentationManager instance\n * @param props Optional properties used to configure the manager\n */\n public static create(props?: PresentationManagerProps) {\n return new PresentationManager(props);\n }\n\n /** @internal */\n public get rpcRequestsHandler() {\n return this._requestsHandler;\n }\n\n /** @internal */\n public get ipcRequestsHandler() {\n return this._ipcRequestsHandler;\n }\n\n /**\n * Get rulesets manager\n */\n public rulesets() {\n return this._rulesets;\n }\n\n /**\n * Get ruleset variables manager for specific ruleset\n * @param rulesetId Id of the ruleset to get the vars manager for\n */\n public vars(rulesetId: string) {\n if (!this._rulesetVars.has(rulesetId)) {\n const varsManager = new RulesetVariablesManagerImpl(rulesetId, this._ipcRequestsHandler);\n this._rulesetVars.set(rulesetId, varsManager);\n }\n return this._rulesetVars.get(rulesetId)!;\n }\n\n private toRpcTokenOptions<TOptions extends { imodel: IModelConnection; locale?: string; unitSystem?: UnitSystemKey; rulesetVariables?: RulesetVariable[] }>(\n requestOptions: TOptions,\n ) {\n // 1. put default `locale` and `unitSystem`\n // 2. put all `requestOptions` members (if `locale` or `unitSystem` are set, they'll override the defaults put at #1)\n // 3. put `imodel` of type `IModelRpcProps` which overwrites the `imodel` from `requestOptions` put at #2\n const defaultOptions: Pick<TOptions, \"locale\" | \"unitSystem\"> = {};\n if (this.activeLocale) {\n defaultOptions.locale = this.activeLocale;\n }\n defaultOptions.unitSystem = this.activeUnitSystem; // eslint-disable-line deprecation/deprecation\n\n const { imodel, rulesetVariables, ...rpcRequestOptions } = requestOptions;\n return {\n ...defaultOptions,\n ...rpcRequestOptions,\n ...(rulesetVariables ? { rulesetVariables: rulesetVariables.map(RulesetVariable.toJSON) } : {}),\n imodel: imodel.getRpcProps(),\n };\n }\n\n private async addRulesetAndVariablesToOptions<TOptions extends { rulesetOrId: Ruleset | string; rulesetVariables?: RulesetVariable[] }>(options: TOptions) {\n const { rulesetOrId, rulesetVariables } = options;\n let foundRulesetOrId: Ruleset | string;\n if (typeof rulesetOrId === \"object\") {\n foundRulesetOrId = rulesetOrId;\n } else {\n const foundRuleset = await this._rulesets.get(rulesetOrId);\n foundRulesetOrId = foundRuleset ? foundRuleset.toJSON() : rulesetOrId;\n }\n const rulesetId = typeof foundRulesetOrId === \"object\" ? foundRulesetOrId.id : foundRulesetOrId;\n\n // All Id64Array variable values must be sorted for serialization to JSON to work. RulesetVariablesManager\n // sorts them before storing, so that part is taken care of, but we need to ensure that variables coming from\n // request options are also sorted.\n const variables = (rulesetVariables ?? []).map((variable) => {\n if (variable.type === VariableValueTypes.Id64Array) {\n return { ...variable, value: OrderedId64Iterable.sortArray(variable.value) };\n }\n return variable;\n });\n if (!this._ipcRequestsHandler) {\n // only need to add variables from variables manager if there's no IPC\n // handler - if there is one, the variables are already known by the backend\n variables.push(...this.vars(rulesetId).getAllVariables());\n }\n\n return { ...options, rulesetOrId: foundRulesetOrId, rulesetVariables: variables };\n }\n\n /** Returns an iterator that polls nodes asynchronously. */\n public async getNodesIterator(\n requestOptions: GetNodesRequestOptions & MultipleValuesRequestOptions,\n ): Promise<{ total: number; items: AsyncIterableIterator<Node> }> {\n this.startIModelInitialization(requestOptions.imodel);\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\n const rpcOptions = this.toRpcTokenOptions({ ...options });\n\n const generator = new StreamedResponseGenerator({\n ...requestOptions,\n getBatch: async (paging) => {\n const result = await this._requestsHandler.getPagedNodes({ ...rpcOptions, paging });\n return {\n total: result.total,\n // eslint-disable-next-line deprecation/deprecation\n items: this._localizationHelper.getLocalizedNodes(result.items.map(Node.fromJSON)),\n };\n },\n });\n\n return generator.createAsyncIteratorResponse();\n }\n\n /**\n * Retrieves nodes\n * @deprecated in 4.5. Use [[getNodesIterator]] instead.\n */\n public async getNodes(requestOptions: GetNodesRequestOptions & MultipleValuesRequestOptions): Promise<Node[]> {\n const result = await this.getNodesIterator(requestOptions);\n return collect(result.items);\n }\n\n /** Retrieves nodes count. */\n public async getNodesCount(requestOptions: GetNodesRequestOptions): Promise<number> {\n this.startIModelInitialization(requestOptions.imodel);\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\n const rpcOptions = this.toRpcTokenOptions({ ...options });\n return this._requestsHandler.getNodesCount(rpcOptions);\n }\n\n /**\n * Retrieves total nodes count and a single page of nodes.\n * @deprecated in 4.5. Use [[getNodesIterator]] instead.\n */\n public async getNodesAndCount(requestOptions: GetNodesRequestOptions & MultipleValuesRequestOptions): Promise<{ count: number; nodes: Node[] }> {\n const result = await this.getNodesIterator(requestOptions);\n return {\n count: result.total,\n nodes: await collect(result.items),\n };\n }\n\n /**\n * Retrieves hierarchy level descriptor.\n * @beta\n */\n public async getNodesDescriptor(\n requestOptions: HierarchyLevelDescriptorRequestOptions<IModelConnection, NodeKey, RulesetVariable> & ClientDiagnosticsAttribute,\n ): Promise<Descriptor | undefined> {\n this.startIModelInitialization(requestOptions.imodel);\n try {\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\n const rpcOptions = this.toRpcTokenOptions({ ...options });\n const result = await this._requestsHandler.getNodesDescriptor(rpcOptions);\n const descriptor = Descriptor.fromJSON(result);\n return descriptor ? this._localizationHelper.getLocalizedContentDescriptor(descriptor) : undefined;\n } finally {\n await this.ensureIModelInitialized(requestOptions.imodel);\n }\n }\n\n /** Retrieves paths from root nodes to children nodes according to specified keys. Intersecting paths will be merged. */\n public async getNodePaths(\n requestOptions: FilterByInstancePathsHierarchyRequestOptions<IModelConnection, RulesetVariable> & ClientDiagnosticsAttribute,\n ): Promise<NodePathElement[]> {\n this.startIModelInitialization(requestOptions.imodel);\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\n const rpcOptions = this.toRpcTokenOptions({ ...options });\n const result = await this._requestsHandler.getNodePaths(rpcOptions);\n // eslint-disable-next-line deprecation/deprecation\n return result.map(NodePathElement.fromJSON).map((npe) => this._localizationHelper.getLocalizedNodePathElement(npe));\n }\n\n /** Retrieves paths from root nodes to nodes containing filter text in their label. */\n public async getFilteredNodePaths(\n requestOptions: FilterByTextHierarchyRequestOptions<IModelConnection, RulesetVariable> & ClientDiagnosticsAttribute,\n ): Promise<NodePathElement[]> {\n this.startIModelInitialization(requestOptions.imodel);\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\n const result = await this._requestsHandler.getFilteredNodePaths(this.toRpcTokenOptions(options));\n // eslint-disable-next-line deprecation/deprecation\n return result.map(NodePathElement.fromJSON).map((npe) => this._localizationHelper.getLocalizedNodePathElement(npe));\n }\n\n /**\n * Get information about the sources of content when building it for specific ECClasses. Sources involve classes of the primary select instance,\n * its related instances for loading related and navigation properties.\n * @public\n */\n public async getContentSources(requestOptions: ContentSourcesRequestOptions<IModelConnection> & ClientDiagnosticsAttribute): Promise<SelectClassInfo[]> {\n this.startIModelInitialization(requestOptions.imodel);\n const rpcOptions = this.toRpcTokenOptions(requestOptions);\n const result = await this._requestsHandler.getContentSources(rpcOptions);\n return SelectClassInfo.listFromCompressedJSON(result.sources, result.classesMap);\n }\n\n /** Retrieves the content descriptor which describes the content and can be used to customize it. */\n public async getContentDescriptor(\n requestOptions: ContentDescriptorRequestOptions<IModelConnection, KeySet, RulesetVariable> & ClientDiagnosticsAttribute,\n ): Promise<Descriptor | undefined> {\n this.startIModelInitialization(requestOptions.imodel);\n try {\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\n const rpcOptions = this.toRpcTokenOptions({\n ...options,\n keys: stripTransientElementKeys(options.keys).toJSON(),\n });\n const result = await this._requestsHandler.getContentDescriptor(rpcOptions);\n const descriptor = Descriptor.fromJSON(result);\n return descriptor ? this._localizationHelper.getLocalizedContentDescriptor(descriptor) : undefined;\n } finally {\n await this.ensureIModelInitialized(requestOptions.imodel);\n }\n }\n\n /** Retrieves overall content set size. */\n public async getContentSetSize(requestOptions: GetContentRequestOptions): Promise<number> {\n this.startIModelInitialization(requestOptions.imodel);\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\n const rpcOptions = this.toRpcTokenOptions({\n ...options,\n descriptor: getDescriptorOverrides(requestOptions.descriptor),\n keys: stripTransientElementKeys(requestOptions.keys).toJSON(),\n });\n return this._requestsHandler.getContentSetSize(rpcOptions);\n }\n\n private async getContentIteratorInternal(\n requestOptions: GetContentRequestOptions & MultipleValuesRequestOptions,\n ): Promise<{ descriptor: Descriptor; total: number; items: AsyncIterableIterator<Item> } | undefined> {\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\n const rpcOptions = this.toRpcTokenOptions({\n ...options,\n descriptor: getDescriptorOverrides(requestOptions.descriptor),\n keys: stripTransientElementKeys(requestOptions.keys).toJSON(),\n ...(!requestOptions.omitFormattedValues && this._schemaContextProvider !== undefined ? { omitFormattedValues: true } : undefined),\n });\n\n let contentFormatter: ContentFormatter | undefined;\n if (!requestOptions.omitFormattedValues && this._schemaContextProvider) {\n const koqPropertyFormatter = new KoqPropertyValueFormatter(this._schemaContextProvider(requestOptions.imodel), this._defaultFormats);\n contentFormatter = new ContentFormatter(\n new ContentPropertyValueFormatter(koqPropertyFormatter),\n requestOptions.unitSystem ?? this._explicitActiveUnitSystem ?? IModelApp.quantityFormatter.activeUnitSystem,\n );\n }\n\n let descriptor = requestOptions.descriptor instanceof Descriptor ? requestOptions.descriptor : undefined;\n let firstPage: PagedResponse<ItemJSON> | undefined;\n if (!descriptor) {\n const firstPageResponse = await this._requestsHandler.getPagedContent(rpcOptions);\n if (!firstPageResponse?.descriptor || !firstPageResponse.contentSet) {\n return undefined;\n }\n descriptor = Descriptor.fromJSON(firstPageResponse?.descriptor);\n firstPage = firstPageResponse?.contentSet;\n }\n\n // istanbul ignore if\n if (!descriptor) {\n return undefined;\n }\n\n descriptor = this._localizationHelper.getLocalizedContentDescriptor(descriptor);\n\n const getPage = async (paging: Required<PageOptions>, requestIndex: number) => {\n let contentSet = requestIndex === 0 ? firstPage : undefined;\n contentSet ??= await this._requestsHandler.getPagedContentSet({ ...rpcOptions, paging });\n\n let items = contentSet.items.map((x) => Item.fromJSON(x)).filter((x): x is Item => x !== undefined);\n if (contentFormatter) {\n items = await contentFormatter.formatContentItems(items, descriptor!);\n }\n\n items = this._localizationHelper.getLocalizedContentItems(items);\n return {\n total: contentSet.total,\n items,\n };\n };\n\n const generator = new StreamedResponseGenerator({\n ...requestOptions,\n getBatch: getPage,\n });\n\n return {\n ...(await generator.createAsyncIteratorResponse()),\n descriptor,\n };\n }\n\n /** Retrieves a content descriptor, item count and async generator for the items themselves. */\n public async getContentIterator(\n requestOptions: GetContentRequestOptions & MultipleValuesRequestOptions,\n ): Promise<{ descriptor: Descriptor; total: number; items: AsyncIterableIterator<Item> } | undefined> {\n this.startIModelInitialization(requestOptions.imodel);\n const response = await this.getContentIteratorInternal(requestOptions);\n if (!response) {\n return undefined;\n }\n\n await this.ensureIModelInitialized(requestOptions.imodel);\n return response;\n }\n\n /**\n * Retrieves content which consists of a content descriptor and a page of records.\n * @deprecated in 4.5. Use [[getContentIterator]] instead.\n */\n public async getContent(requestOptions: GetContentRequestOptions & MultipleValuesRequestOptions): Promise<Content | undefined> {\n // eslint-disable-next-line deprecation/deprecation\n return (await this.getContentAndSize(requestOptions))?.content;\n }\n\n /**\n * Retrieves content set size and content which consists of a content descriptor and a page of records.\n * @deprecated in 4.5. Use [[getContentIterator]] instead.\n */\n public async getContentAndSize(\n requestOptions: GetContentRequestOptions & MultipleValuesRequestOptions,\n ): Promise<{ content: Content; size: number } | undefined> {\n const response = await this.getContentIterator(requestOptions);\n if (!response) {\n return undefined;\n }\n\n const { descriptor, total } = response;\n const items = await collect(response.items);\n return {\n content: new Content(descriptor, items),\n size: total,\n };\n }\n\n /** Returns an iterator that asynchronously polls distinct values of specific field from the content. */\n public async getDistinctValuesIterator(\n requestOptions: GetDistinctValuesRequestOptions & MultipleValuesRequestOptions,\n ): Promise<{ total: number; items: AsyncIterableIterator<DisplayValueGroup> }> {\n this.startIModelInitialization(requestOptions.imodel);\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\n const rpcOptions = {\n ...this.toRpcTokenOptions(options),\n descriptor: getDescriptorOverrides(options.descriptor),\n keys: stripTransientElementKeys(options.keys).toJSON(),\n };\n\n const generator = new StreamedResponseGenerator({\n ...requestOptions,\n getBatch: async (paging) => {\n const response = await this._requestsHandler.getPagedDistinctValues({ ...rpcOptions, paging });\n return {\n total: response.total,\n // eslint-disable-next-line deprecation/deprecation\n items: response.items.map((x) => this._localizationHelper.getLocalizedDisplayValueGroup(DisplayValueGroup.fromJSON(x))),\n };\n },\n });\n\n return generator.createAsyncIteratorResponse();\n }\n\n /**\n * Retrieves distinct values of specific field from the content.\n * @deprecated in 4.5. Use [[getDistinctValuesIterator]] instead.\n */\n public async getPagedDistinctValues(\n requestOptions: GetDistinctValuesRequestOptions & MultipleValuesRequestOptions,\n ): Promise<PagedResponse<DisplayValueGroup>> {\n const result = await this.getDistinctValuesIterator(requestOptions);\n return {\n total: result.total,\n items: await collect(result.items),\n };\n }\n\n /**\n * Retrieves property data in a simplified format for a single element specified by ID.\n * @public\n */\n public async getElementProperties(\n requestOptions: SingleElementPropertiesRequestOptions<IModelConnection> & ClientDiagnosticsAttribute,\n ): Promise<ElementProperties | undefined> {\n this.startIModelInitialization(requestOptions.imodel);\n const results = await this._requestsHandler.getElementProperties(this.toRpcTokenOptions(requestOptions));\n // istanbul ignore if\n if (!results) {\n return undefined;\n }\n return this._localizationHelper.getLocalizedElementProperties(results);\n }\n\n /**\n * Retrieves content item instance keys.\n * @public\n */\n public async getContentInstanceKeys(\n requestOptions: ContentInstanceKeysRequestOptions<IModelConnection, KeySet, RulesetVariable> & ClientDiagnosticsAttribute & MultipleValuesRequestOptions,\n ): Promise<{ total: number; items: () => AsyncGenerator<InstanceKey> }> {\n this.startIModelInitialization(requestOptions.imodel);\n const options = await this.addRulesetAndVariablesToOptions(requestOptions);\n const rpcOptions = {\n ...this.toRpcTokenOptions(options),\n keys: stripTransientElementKeys(options.keys).toJSON(),\n };\n\n const generator = new StreamedResponseGenerator({\n ...requestOptions,\n getBatch: async (page) => {\n const keys = await this._requestsHandler.getContentInstanceKeys({ ...rpcOptions, paging: page });\n return {\n total: keys.total,\n items: keys.items.instanceKeys.reduce((instanceKeys, entry) => {\n for (const id of CompressedId64Set.iterable(entry[1])) {\n instanceKeys.push({ className: entry[0], id });\n }\n return instanceKeys;\n }, new Array<InstanceKey>()),\n };\n },\n });\n\n const { total, items } = await generator.createAsyncIteratorResponse();\n return {\n total,\n async *items() {\n yield* items;\n },\n };\n }\n\n /** Retrieves display label definition of specific item. */\n public async getDisplayLabelDefinition(\n requestOptions: DisplayLabelRequestOptions<IModelConnection, InstanceKey> & ClientDiagnosticsAttribute,\n ): Promise<LabelDefinition> {\n this.startIModelInitialization(requestOptions.imodel);\n const rpcOptions = this.toRpcTokenOptions({ ...requestOptions });\n const result = await this._requestsHandler.getDisplayLabelDefinition(rpcOptions);\n return this._localizationHelper.getLocalizedLabelDefinition(result);\n }\n\n /** Retrieves display label definition of specific items. */\n public async getDisplayLabelDefinitionsIterator(\n requestOptions: DisplayLabelsRequestOptions<IModelConnection, InstanceKey> & ClientDiagnosticsAttribute & MultipleValuesRequestOptions,\n ): Promise<{ total: number; items: AsyncIterableIterator<LabelDefinition> }> {\n this.startIModelInitialization(requestOptions.imodel);\n const rpcOptions = this.toRpcTokenOptions({ ...requestOptions });\n const generator = new StreamedResponseGenerator({\n ...requestOptions,\n getBatch: async (page) => {\n const partialKeys = !page.start ? rpcOptions.keys : rpcOptions.keys.slice(page.start);\n const result = await this._requestsHandler.getPagedDisplayLabelDefinitions({ ...rpcOptions, keys: partialKeys });\n result.items = this._localizationHelper.getLocalizedLabelDefinitions(result.items);\n return result;\n },\n });\n\n return generator.createAsyncIteratorResponse();\n }\n\n /**\n * Retrieves display label definition of specific items.\n * @deprecated in 4.5. Use [[getDisplayLabelDefinitionsIterator]] instead.\n */\n public async getDisplayLabelDefinitions(\n requestOptions: DisplayLabelsRequestOptions<IModelConnection, InstanceKey> & ClientDiagnosticsAttribute & MultipleValuesRequestOptions,\n ): Promise<LabelDefinition[]> {\n const { items } = await this.getDisplayLabelDefinitionsIterator(requestOptions);\n return collect(items);\n }\n}\n\nconst getDescriptorOverrides = (descriptorOrOverrides: Descriptor | DescriptorOverrides): DescriptorOverrides => {\n if (descriptorOrOverrides instanceof Descriptor) {\n return descriptorOrOverrides.createDescriptorOverrides();\n }\n return descriptorOrOverrides;\n};\n\nconst stripTransientElementKeys = (keys: KeySet) => {\n if (!keys.some((key) => Key.isInstanceKey(key) && key.className === TRANSIENT_ELEMENT_CLASSNAME)) {\n return keys;\n }\n\n const copy = new KeySet();\n copy.add(keys, (key) => {\n // the callback is not going to be called with EntityProps as KeySet converts them\n // to InstanceKeys, but we want to keep the EntityProps case for correctness\n // istanbul ignore next\n const isTransient =\n (Key.isInstanceKey(key) && key.className === TRANSIENT_ELEMENT_CLASSNAME) ||\n (Key.isEntityProps(key) && key.classFullName === TRANSIENT_ELEMENT_CLASSNAME);\n return !isTransient;\n });\n return copy;\n};\n\nasync function collect<T>(iter: AsyncIterable<T>): Promise<T[]> {\n const result = new Array<T>();\n for await (const value of iter) {\n result.push(value);\n }\n return result;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RulesetManager.d.ts","sourceRoot":"","sources":["../../../src/presentation-frontend/RulesetManager.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAQ,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAExE;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,iBAAiB,EAAE,OAAO,CAAC,CAAC,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC,CAAC;IAE7E;;OAEG;IACH,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC,CAAC;IAExD;;OAEG;IACH,GAAG,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;I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AEG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAED,gBAAgB;AAChB,qBAAa,kBAAmB,YAAW,cAAc;IACvD,OAAO,CAAC,eAAe,CAA0C;IAC1D,iBAAiB,iBAAsB,iBAAiB,QAAQ,OAAO,KAAK,IAAI,EAAI;WAE7E,MAAM;IAIpB;;OAEG;IACU,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC;IAQpE;;OAEG;IACU,GAAG,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAS9D;;OAEG;IACU,MAAM,CAAC,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAO1G;;OAEG;IACU,MAAM,CAAC,OAAO,EAAE,iBAAiB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IA2BpF;;OAEG;IACU,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAOpC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*---------------------------------------------------------------------------------------------
|
|
3
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
-
*--------------------------------------------------------------------------------------------*/
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
6
|
/** @packageDocumentation
|
|
7
7
|
* @module Core
|
|
8
8
|
*/
|
|
@@ -24,8 +24,9 @@ class RulesetManagerImpl {
|
|
|
24
24
|
*/
|
|
25
25
|
async get(id) {
|
|
26
26
|
const m = this._clientRulesets.get(id);
|
|
27
|
-
if (!m)
|
|
27
|
+
if (!m) {
|
|
28
28
|
return undefined;
|
|
29
|
+
}
|
|
29
30
|
return m[0];
|
|
30
31
|
}
|
|
31
32
|
/**
|
|
@@ -33,8 +34,9 @@ class RulesetManagerImpl {
|
|
|
33
34
|
*/
|
|
34
35
|
async add(ruleset) {
|
|
35
36
|
const registered = new presentation_common_1.RegisteredRuleset(ruleset, core_bentley_1.Guid.createValue(), async (r) => this.remove(r));
|
|
36
|
-
if (!this._clientRulesets.has(ruleset.id))
|
|
37
|
+
if (!this._clientRulesets.has(ruleset.id)) {
|
|
37
38
|
this._clientRulesets.set(ruleset.id, []);
|
|
39
|
+
}
|
|
38
40
|
this._clientRulesets.get(ruleset.id).push(registered);
|
|
39
41
|
return registered;
|
|
40
42
|
}
|
|
@@ -61,8 +63,9 @@ class RulesetManagerImpl {
|
|
|
61
63
|
uniqueIdentifier = ruleset.uniqueIdentifier;
|
|
62
64
|
}
|
|
63
65
|
const m = this._clientRulesets.get(rulesetId);
|
|
64
|
-
if (!m)
|
|
66
|
+
if (!m) {
|
|
65
67
|
return false;
|
|
68
|
+
}
|
|
66
69
|
let didRemove = false;
|
|
67
70
|
for (let i = 0; i < m.length; ++i) {
|
|
68
71
|
if (m[i].uniqueIdentifier === uniqueIdentifier) {
|
|
@@ -77,8 +80,9 @@ class RulesetManagerImpl {
|
|
|
77
80
|
* Remove all rulesets registered in this session.
|
|
78
81
|
*/
|
|
79
82
|
async clear() {
|
|
80
|
-
if (0 === this._clientRulesets.size)
|
|
83
|
+
if (0 === this._clientRulesets.size) {
|
|
81
84
|
return;
|
|
85
|
+
}
|
|
82
86
|
this._clientRulesets.clear();
|
|
83
87
|
}
|
|
84
88
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RulesetManager.js","sourceRoot":"","sources":["../../../src/presentation-frontend/RulesetManager.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"RulesetManager.js","sourceRoot":"","sources":["../../../src/presentation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AAC;IAC/B,CAAC;CACF;AAjFD,gDAiFC","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 { BeEvent, Guid } from \"@itwin/core-bentley\";\nimport { RegisteredRuleset, Ruleset } from \"@itwin/presentation-common\";\n\n/**\n * Presentation ruleset registry.\n * @public\n */\nexport interface RulesetManager {\n /**\n * An event invoked one a ruleset is modified using [[modify]] function.\n * @beta\n */\n onRulesetModified: BeEvent<(curr: RegisteredRuleset, prev: Ruleset) => void>;\n\n /**\n * Get a ruleset with the specified id.\n */\n get(id: string): Promise<RegisteredRuleset | undefined>;\n\n /**\n * Register the supplied ruleset\n */\n add(ruleset: Ruleset): Promise<RegisteredRuleset>;\n\n /**\n * Modify the given pre-registered ruleset\n * @beta\n */\n modify(ruleset: RegisteredRuleset, newRules: Omit<Ruleset, \"id\">): Promise<RegisteredRuleset>;\n\n /**\n * Unregister the supplied ruleset\n */\n remove(ruleset: RegisteredRuleset | [string, string]): Promise<boolean>;\n\n /**\n * Remove all rulesets registered in this session.\n */\n clear(): Promise<void>;\n}\n\n/** @internal */\nexport class RulesetManagerImpl implements RulesetManager {\n private _clientRulesets = new Map<string, RegisteredRuleset[]>();\n public onRulesetModified = new BeEvent<(curr: RegisteredRuleset, prev: Ruleset) => void>();\n\n public static create() {\n return new RulesetManagerImpl();\n }\n\n /**\n * Get a ruleset with the specified id.\n */\n public async get(id: string): Promise<RegisteredRuleset | undefined> {\n const m = this._clientRulesets.get(id);\n if (!m) {\n return undefined;\n }\n return m[0];\n }\n\n /**\n * Register the supplied ruleset\n */\n public async add(ruleset: Ruleset): Promise<RegisteredRuleset> {\n const registered = new RegisteredRuleset(ruleset, Guid.createValue(), async (r: RegisteredRuleset) => this.remove(r));\n if (!this._clientRulesets.has(ruleset.id)) {\n this._clientRulesets.set(ruleset.id, []);\n }\n this._clientRulesets.get(ruleset.id)!.push(registered);\n return registered;\n }\n\n /**\n * Modifies the given pre-registered ruleset\n */\n public async modify(ruleset: RegisteredRuleset, newRules: Omit<Ruleset, \"id\">): Promise<RegisteredRuleset> {\n await this.remove(ruleset);\n const modified = await this.add({ ...newRules, id: ruleset.id });\n this.onRulesetModified.raiseEvent(modified, ruleset.toJSON());\n return modified;\n }\n\n /**\n * Unregister the supplied ruleset\n */\n public async remove(ruleset: RegisteredRuleset | [string, string]): Promise<boolean> {\n let rulesetId, uniqueIdentifier: string;\n if (Array.isArray(ruleset)) {\n rulesetId = ruleset[0];\n uniqueIdentifier = ruleset[1];\n } else {\n rulesetId = ruleset.id;\n uniqueIdentifier = ruleset.uniqueIdentifier;\n }\n\n const m = this._clientRulesets.get(rulesetId);\n if (!m) {\n return false;\n }\n\n let didRemove = false;\n for (let i = 0; i < m.length; ++i) {\n if (m[i].uniqueIdentifier === uniqueIdentifier) {\n m.splice(i, 1);\n didRemove = true;\n break;\n }\n }\n\n return didRemove;\n }\n\n /**\n * Remove all rulesets registered in this session.\n */\n public async clear(): Promise<void> {\n if (0 === this._clientRulesets.size) {\n return;\n }\n\n this._clientRulesets.clear();\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RulesetVariablesManager.d.ts","sourceRoot":"","sources":["../../../src/presentation-frontend/RulesetVariablesManager.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAU,OAAO,EAAQ,UAAU,EAAuB,MAAM,qBAAqB,CAAC;AAC7F,OAAO,EAAE,eAAe,EAAE,aAAa,EAAsB,MAAM,4BAA4B,CAAC;AAChG,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D;;;GAGG;AACH,MAAM,WAAW,uBAAuB;
|
|
1
|
+
{"version":3,"file":"RulesetVariablesManager.d.ts","sourceRoot":"","sources":["../../../src/presentation-frontend/RulesetVariablesManager.ts"],"names":[],"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CAAC;IAI1D;;OAEG;IACU,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAIvE;;;OAGG;IACU,MAAM,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAIxD;;OAEG;IACU,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIrE;;;OAGG;IACU,OAAO,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAI3D;;OAEG;IACU,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAIxE;;;OAGG;IACU,OAAO,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAI7D;;OAEG;IACU,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAI1E;;;OAGG;IACU,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAIhE;;OAEG;IACU,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAG9E"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*---------------------------------------------------------------------------------------------
|
|
3
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
-
*--------------------------------------------------------------------------------------------*/
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
6
|
/** @packageDocumentation
|
|
7
7
|
* @module Core
|
|
8
8
|
*/
|
|
@@ -20,62 +20,80 @@ class RulesetVariablesManagerImpl {
|
|
|
20
20
|
}
|
|
21
21
|
getAllVariables() {
|
|
22
22
|
const variables = [];
|
|
23
|
-
for (const entry of this._clientValues)
|
|
23
|
+
for (const entry of this._clientValues) {
|
|
24
24
|
variables.push(entry[1]);
|
|
25
|
+
}
|
|
25
26
|
return variables;
|
|
26
27
|
}
|
|
27
28
|
changeValueType(variable, toType) {
|
|
28
29
|
switch (toType) {
|
|
29
30
|
case presentation_common_1.VariableValueTypes.Bool:
|
|
30
31
|
switch (variable.type) {
|
|
31
|
-
case presentation_common_1.VariableValueTypes.Int:
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
case presentation_common_1.VariableValueTypes.Int:
|
|
33
|
+
return 0 !== variable.value;
|
|
34
|
+
case presentation_common_1.VariableValueTypes.Id64:
|
|
35
|
+
return core_bentley_1.Id64.isValidId64(variable.value);
|
|
36
|
+
default:
|
|
37
|
+
return undefined;
|
|
34
38
|
}
|
|
35
39
|
case presentation_common_1.VariableValueTypes.Int:
|
|
36
40
|
switch (variable.type) {
|
|
37
|
-
case presentation_common_1.VariableValueTypes.Bool:
|
|
38
|
-
|
|
39
|
-
|
|
41
|
+
case presentation_common_1.VariableValueTypes.Bool:
|
|
42
|
+
return variable.value ? 1 : 0;
|
|
43
|
+
case presentation_common_1.VariableValueTypes.Id64:
|
|
44
|
+
return core_bentley_1.Id64.getUpperUint32(variable.value);
|
|
45
|
+
default:
|
|
46
|
+
return undefined;
|
|
40
47
|
}
|
|
41
48
|
case presentation_common_1.VariableValueTypes.IntArray:
|
|
42
49
|
switch (variable.type) {
|
|
43
|
-
case presentation_common_1.VariableValueTypes.Id64Array:
|
|
44
|
-
|
|
50
|
+
case presentation_common_1.VariableValueTypes.Id64Array:
|
|
51
|
+
return variable.value.map((id) => core_bentley_1.Id64.getUpperUint32(id));
|
|
52
|
+
default:
|
|
53
|
+
return undefined;
|
|
45
54
|
}
|
|
46
55
|
case presentation_common_1.VariableValueTypes.Id64:
|
|
47
56
|
switch (variable.type) {
|
|
48
|
-
case presentation_common_1.VariableValueTypes.Bool:
|
|
49
|
-
|
|
50
|
-
|
|
57
|
+
case presentation_common_1.VariableValueTypes.Bool:
|
|
58
|
+
return core_bentley_1.Id64.fromLocalAndBriefcaseIds(variable.value ? 1 : 0, 0);
|
|
59
|
+
case presentation_common_1.VariableValueTypes.Int:
|
|
60
|
+
return core_bentley_1.Id64.fromLocalAndBriefcaseIds(variable.value, 0);
|
|
61
|
+
default:
|
|
62
|
+
return undefined;
|
|
51
63
|
}
|
|
52
64
|
case presentation_common_1.VariableValueTypes.Id64Array:
|
|
53
65
|
switch (variable.type) {
|
|
54
|
-
case presentation_common_1.VariableValueTypes.IntArray:
|
|
55
|
-
|
|
66
|
+
case presentation_common_1.VariableValueTypes.IntArray:
|
|
67
|
+
return variable.value.map((int) => core_bentley_1.Id64.fromLocalAndBriefcaseIds(int, 0));
|
|
68
|
+
default:
|
|
69
|
+
return undefined;
|
|
56
70
|
}
|
|
57
71
|
case presentation_common_1.VariableValueTypes.String:
|
|
58
72
|
switch (variable.type) {
|
|
59
73
|
case presentation_common_1.VariableValueTypes.IntArray:
|
|
60
74
|
case presentation_common_1.VariableValueTypes.Id64Array:
|
|
61
75
|
return undefined;
|
|
62
|
-
default:
|
|
76
|
+
default:
|
|
77
|
+
variable.value.toString();
|
|
63
78
|
}
|
|
64
79
|
}
|
|
65
80
|
return undefined;
|
|
66
81
|
}
|
|
67
82
|
async getValue(id, type) {
|
|
68
83
|
const variable = this._clientValues.get(id);
|
|
69
|
-
if (!variable)
|
|
84
|
+
if (!variable) {
|
|
70
85
|
return undefined;
|
|
71
|
-
|
|
86
|
+
}
|
|
87
|
+
if (variable.type !== type) {
|
|
72
88
|
return this.changeValueType(variable, type);
|
|
89
|
+
}
|
|
73
90
|
return variable.value;
|
|
74
91
|
}
|
|
75
92
|
async setValue(variable) {
|
|
76
93
|
const oldVariable = this._clientValues.get(variable.id);
|
|
77
|
-
if (oldVariable && variablesEqual(oldVariable, variable))
|
|
94
|
+
if (oldVariable && variablesEqual(oldVariable, variable)) {
|
|
78
95
|
return;
|
|
96
|
+
}
|
|
79
97
|
this._clientValues.set(variable.id, variable);
|
|
80
98
|
if (this._ipcHandler) {
|
|
81
99
|
await this._ipcHandler.setRulesetVariable({ rulesetId: this._rulesetId, variable });
|
|
@@ -84,8 +102,9 @@ class RulesetVariablesManagerImpl {
|
|
|
84
102
|
}
|
|
85
103
|
async unset(variableId) {
|
|
86
104
|
const variable = this._clientValues.get(variableId);
|
|
87
|
-
if (variable === undefined)
|
|
105
|
+
if (variable === undefined) {
|
|
88
106
|
return;
|
|
107
|
+
}
|
|
89
108
|
this._clientValues.delete(variable.id);
|
|
90
109
|
if (this._ipcHandler) {
|
|
91
110
|
await this._ipcHandler.unsetRulesetVariable({ rulesetId: this._rulesetId, variableId });
|
|
@@ -97,7 +116,7 @@ class RulesetVariablesManagerImpl {
|
|
|
97
116
|
* Returns empty string if variable does not exist or does not convert to string.
|
|
98
117
|
*/
|
|
99
118
|
async getString(variableId) {
|
|
100
|
-
return await this.getValue(variableId, presentation_common_1.VariableValueTypes.String) || "";
|
|
119
|
+
return (await this.getValue(variableId, presentation_common_1.VariableValueTypes.String)) || "";
|
|
101
120
|
}
|
|
102
121
|
/**
|
|
103
122
|
* Sets `string` variable value
|
|
@@ -110,7 +129,7 @@ class RulesetVariablesManagerImpl {
|
|
|
110
129
|
* Returns `false` if variable does not exist or does not convert to boolean.
|
|
111
130
|
*/
|
|
112
131
|
async getBool(variableId) {
|
|
113
|
-
return await this.getValue(variableId, presentation_common_1.VariableValueTypes.Bool) || false;
|
|
132
|
+
return (await this.getValue(variableId, presentation_common_1.VariableValueTypes.Bool)) || false;
|
|
114
133
|
}
|
|
115
134
|
/**
|
|
116
135
|
* Sets `boolean` variable value
|
|
@@ -123,7 +142,7 @@ class RulesetVariablesManagerImpl {
|
|
|
123
142
|
* Returns `0` if variable does not exist or does not convert to integer.
|
|
124
143
|
*/
|
|
125
144
|
async getInt(variableId) {
|
|
126
|
-
return await this.getValue(variableId, presentation_common_1.VariableValueTypes.Int) || 0;
|
|
145
|
+
return (await this.getValue(variableId, presentation_common_1.VariableValueTypes.Int)) || 0;
|
|
127
146
|
}
|
|
128
147
|
/**
|
|
129
148
|
* Sets `number` variable value
|
|
@@ -136,7 +155,7 @@ class RulesetVariablesManagerImpl {
|
|
|
136
155
|
* Returns empty array if variable does not exist or does not convert to integer array.
|
|
137
156
|
*/
|
|
138
157
|
async getInts(variableId) {
|
|
139
|
-
return await this.getValue(variableId, presentation_common_1.VariableValueTypes.IntArray) || [];
|
|
158
|
+
return (await this.getValue(variableId, presentation_common_1.VariableValueTypes.IntArray)) || [];
|
|
140
159
|
}
|
|
141
160
|
/**
|
|
142
161
|
* Sets `number[]` variable value
|
|
@@ -149,7 +168,7 @@ class RulesetVariablesManagerImpl {
|
|
|
149
168
|
* Returns invalid Id64String if variable does not exist or does not convert to Id64String.
|
|
150
169
|
*/
|
|
151
170
|
async getId64(variableId) {
|
|
152
|
-
return await this.getValue(variableId, presentation_common_1.VariableValueTypes.Id64) || core_bentley_1.Id64.invalid;
|
|
171
|
+
return (await this.getValue(variableId, presentation_common_1.VariableValueTypes.Id64)) || core_bentley_1.Id64.invalid;
|
|
153
172
|
}
|
|
154
173
|
/**
|
|
155
174
|
* Sets `Id64String` variable value
|
|
@@ -162,7 +181,7 @@ class RulesetVariablesManagerImpl {
|
|
|
162
181
|
* Returns empty array if variable does not exist or does not convert to Id64String array.
|
|
163
182
|
*/
|
|
164
183
|
async getId64s(variableId) {
|
|
165
|
-
return await this.getValue(variableId, presentation_common_1.VariableValueTypes.Id64Array) || [];
|
|
184
|
+
return (await this.getValue(variableId, presentation_common_1.VariableValueTypes.Id64Array)) || [];
|
|
166
185
|
}
|
|
167
186
|
/**
|
|
168
187
|
* Sets `Id64String[]` variable value
|
|
@@ -173,8 +192,9 @@ class RulesetVariablesManagerImpl {
|
|
|
173
192
|
}
|
|
174
193
|
exports.RulesetVariablesManagerImpl = RulesetVariablesManagerImpl;
|
|
175
194
|
function variablesEqual(lhs, rhs) {
|
|
176
|
-
if (lhs.type !== rhs.type)
|
|
195
|
+
if (lhs.type !== rhs.type) {
|
|
177
196
|
return false;
|
|
197
|
+
}
|
|
178
198
|
switch (lhs.type) {
|
|
179
199
|
case presentation_common_1.VariableValueTypes.IntArray:
|
|
180
200
|
case presentation_common_1.VariableValueTypes.Id64Array:
|
|
@@ -185,11 +205,13 @@ function variablesEqual(lhs, rhs) {
|
|
|
185
205
|
}
|
|
186
206
|
}
|
|
187
207
|
function arraysEqual(lhs, rhs) {
|
|
188
|
-
if (lhs.length !== rhs.length)
|
|
208
|
+
if (lhs.length !== rhs.length) {
|
|
189
209
|
return false;
|
|
210
|
+
}
|
|
190
211
|
for (let i = 0; i < lhs.length; ++i) {
|
|
191
|
-
if (lhs[i] !== rhs[i])
|
|
212
|
+
if (lhs[i] !== rhs[i]) {
|
|
192
213
|
return false;
|
|
214
|
+
}
|
|
193
215
|
}
|
|
194
216
|
return true;
|
|
195
217
|
}
|