@itwin/presentation-backend 4.4.0-dev.8 → 4.5.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 +6 -1
- package/lib/cjs/presentation-backend/ElementPropertiesHelper.d.ts +12 -3
- package/lib/cjs/presentation-backend/ElementPropertiesHelper.d.ts.map +1 -1
- package/lib/cjs/presentation-backend/ElementPropertiesHelper.js +76 -74
- package/lib/cjs/presentation-backend/ElementPropertiesHelper.js.map +1 -1
- package/lib/cjs/presentation-backend/NativePlatform.d.ts +1 -0
- package/lib/cjs/presentation-backend/NativePlatform.d.ts.map +1 -1
- package/lib/cjs/presentation-backend/NativePlatform.js +1 -0
- package/lib/cjs/presentation-backend/NativePlatform.js.map +1 -1
- package/lib/cjs/presentation-backend/PresentationManager.d.ts +9 -4
- package/lib/cjs/presentation-backend/PresentationManager.d.ts.map +1 -1
- package/lib/cjs/presentation-backend/PresentationManager.js +107 -40
- package/lib/cjs/presentation-backend/PresentationManager.js.map +1 -1
- package/lib/cjs/presentation-backend/PresentationManagerDetail.d.ts +2 -1
- package/lib/cjs/presentation-backend/PresentationManagerDetail.d.ts.map +1 -1
- package/lib/cjs/presentation-backend/PresentationManagerDetail.js +16 -2
- package/lib/cjs/presentation-backend/PresentationManagerDetail.js.map +1 -1
- package/lib/cjs/presentation-backend/PresentationRpcImpl.js +3 -3
- package/lib/cjs/presentation-backend/PresentationRpcImpl.js.map +1 -1
- package/package.json +16 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
# Change Log - @itwin/presentation-backend
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Wed, 03 Jan 2024 19:29:41 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 4.3.3
|
|
6
|
+
Wed, 03 Jan 2024 19:28:38 GMT
|
|
7
|
+
|
|
8
|
+
_Version update only_
|
|
4
9
|
|
|
5
10
|
## 4.3.2
|
|
6
11
|
Thu, 14 Dec 2023 20:23:02 GMT
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
/** @packageDocumentation
|
|
2
2
|
* @module Core
|
|
3
3
|
*/
|
|
4
|
+
import { Observable } from "rxjs";
|
|
4
5
|
import { IModelDb } from "@itwin/core-backend";
|
|
5
|
-
import {
|
|
6
|
+
import { Id64String } from "@itwin/core-bentley";
|
|
7
|
+
import { Descriptor, ElementProperties, Item } from "@itwin/presentation-common";
|
|
6
8
|
/** @internal */
|
|
7
|
-
export declare const
|
|
9
|
+
export declare const buildElementProperties: (descriptor: Descriptor, item: Item) => ElementProperties;
|
|
8
10
|
/** @internal */
|
|
9
11
|
export declare function getElementsCount(db: IModelDb, classNames?: string[]): number;
|
|
10
12
|
/** @internal */
|
|
11
|
-
export declare function
|
|
13
|
+
export declare function parseFullClassName(fullClassName: string): [string, string];
|
|
14
|
+
/** @internal */
|
|
15
|
+
export declare function getClassesWithInstances(imodel: IModelDb, fullClassNames: string[]): Observable<string>;
|
|
16
|
+
/** @internal */
|
|
17
|
+
export declare function getBatchedClassElementIds(imodel: IModelDb, fullClassName: string, batchSize: number): Promise<Array<{
|
|
18
|
+
from: Id64String;
|
|
19
|
+
to: Id64String;
|
|
20
|
+
}>>;
|
|
12
21
|
//# sourceMappingURL=ElementPropertiesHelper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElementPropertiesHelper.d.ts","sourceRoot":"","sources":["../../../src/presentation-backend/ElementPropertiesHelper.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAkB,QAAQ,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"ElementPropertiesHelper.d.ts","sourceRoot":"","sources":["../../../src/presentation-backend/ElementPropertiesHelper.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAA4B,UAAU,EAAU,MAAM,MAAM,CAAC;AACpE,OAAO,EAAkB,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAA0B,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAEL,UAAU,EACV,iBAAiB,EAMjB,IAAI,EAcL,MAAM,4BAA4B,CAAC;AAEpC,gBAAgB;AAChB,eAAO,MAAM,sBAAsB,eAAgB,UAAU,QAAQ,IAAI,KAAG,iBAI3E,CAAC;AAEF,gBAAgB;AAChB,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,QAAQ,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,UAWnE;AAED,gBAAgB;AAChB,wBAAgB,kBAAkB,CAAC,aAAa,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAG1E;AAOD,gBAAgB;AAChB,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,MAAM,CAAC,CAmBtG;AAED,gBAAgB;AAChB,wBAAsB,yBAAyB,CAC7C,MAAM,EAAE,QAAQ,EAChB,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,KAAK,CAAC;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,EAAE,EAAE,UAAU,CAAA;CAAE,CAAC,CAAC,CAqBtD"}
|
|
@@ -1,24 +1,23 @@
|
|
|
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
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.
|
|
10
|
+
exports.getBatchedClassElementIds = exports.getClassesWithInstances = exports.parseFullClassName = exports.getElementsCount = exports.buildElementProperties = void 0;
|
|
11
|
+
const rxjs_1 = require("rxjs");
|
|
11
12
|
const core_bentley_1 = require("@itwin/core-bentley");
|
|
12
13
|
const presentation_common_1 = require("@itwin/presentation-common");
|
|
13
14
|
/** @internal */
|
|
14
|
-
const
|
|
15
|
-
if (!content || content.contentSet.length === 0)
|
|
16
|
-
return [];
|
|
15
|
+
const buildElementProperties = (descriptor, item) => {
|
|
17
16
|
const builder = new ElementPropertiesBuilder();
|
|
18
|
-
(0, presentation_common_1.
|
|
19
|
-
return builder.items;
|
|
17
|
+
(0, presentation_common_1.traverseContentItem)(builder, descriptor, item);
|
|
18
|
+
return builder.items[0];
|
|
20
19
|
};
|
|
21
|
-
exports.
|
|
20
|
+
exports.buildElementProperties = buildElementProperties;
|
|
22
21
|
/** @internal */
|
|
23
22
|
function getElementsCount(db, classNames) {
|
|
24
23
|
const filter = createElementsFilter("e", classNames);
|
|
@@ -33,68 +32,60 @@ function getElementsCount(db, classNames) {
|
|
|
33
32
|
}
|
|
34
33
|
exports.getElementsCount = getElementsCount;
|
|
35
34
|
/** @internal */
|
|
36
|
-
function
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const result = queryElementIds(db, classNames, limit, lastElementId);
|
|
40
|
-
yield result.ids;
|
|
41
|
-
lastElementId = result.lastElementId;
|
|
42
|
-
if (!lastElementId)
|
|
43
|
-
break;
|
|
44
|
-
}
|
|
35
|
+
function parseFullClassName(fullClassName) {
|
|
36
|
+
const [schemaName, className] = fullClassName.split(/[:\.]/);
|
|
37
|
+
return [schemaName, className];
|
|
45
38
|
}
|
|
46
|
-
exports.
|
|
47
|
-
function
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
if (!existingIds) {
|
|
80
|
-
currentIds = [];
|
|
81
|
-
ids.set(row.elClassName, currentIds);
|
|
82
|
-
}
|
|
83
|
-
else {
|
|
84
|
-
currentIds = existingIds;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
currentIds.push(row.elId);
|
|
88
|
-
loadedIds++;
|
|
89
|
-
if (limit && loadedIds >= limit)
|
|
90
|
-
return { ids, lastElementId: row.elId };
|
|
39
|
+
exports.parseFullClassName = parseFullClassName;
|
|
40
|
+
function getECSqlName(fullClassName) {
|
|
41
|
+
const [schemaName, className] = parseFullClassName(fullClassName);
|
|
42
|
+
return `[${schemaName}].[${className}]`;
|
|
43
|
+
}
|
|
44
|
+
/** @internal */
|
|
45
|
+
function getClassesWithInstances(imodel, fullClassNames) {
|
|
46
|
+
return (0, rxjs_1.from)(fullClassNames).pipe((0, rxjs_1.mergeMap)((fullClassName) => {
|
|
47
|
+
const reader = imodel.createQueryReader(`
|
|
48
|
+
SELECT s.Name, c.Name
|
|
49
|
+
FROM ${getECSqlName(fullClassName)} e
|
|
50
|
+
JOIN meta.ECClassDef c ON c.ECInstanceId = e.ECClassId
|
|
51
|
+
JOIN meta.ECSchemaDef s on s.ECInstanceId = c.Schema.Id
|
|
52
|
+
GROUP BY c.ECInstanceId
|
|
53
|
+
`);
|
|
54
|
+
return (0, rxjs_1.from)(reader.toArray());
|
|
55
|
+
}), (0, rxjs_1.mergeAll)(), (0, rxjs_1.reduce)((set, [schemaName, className]) => {
|
|
56
|
+
set.add(`${schemaName}.${className}`);
|
|
57
|
+
return set;
|
|
58
|
+
}, new Set()), (0, rxjs_1.mergeMap)((set) => [...set]));
|
|
59
|
+
}
|
|
60
|
+
exports.getClassesWithInstances = getClassesWithInstances;
|
|
61
|
+
/** @internal */
|
|
62
|
+
async function getBatchedClassElementIds(imodel, fullClassName, batchSize) {
|
|
63
|
+
const batches = [];
|
|
64
|
+
const reader = imodel.createQueryReader(`SELECT ECInstanceId id FROM ${getECSqlName(fullClassName)} ORDER BY ECInstanceId`);
|
|
65
|
+
let currId;
|
|
66
|
+
let fromId;
|
|
67
|
+
let count = 0;
|
|
68
|
+
while (await reader.step()) {
|
|
69
|
+
currId = reader.current.toRow().id;
|
|
70
|
+
if (!fromId) {
|
|
71
|
+
fromId = currId;
|
|
91
72
|
}
|
|
92
|
-
|
|
93
|
-
|
|
73
|
+
if (++count >= batchSize) {
|
|
74
|
+
batches.push({ from: fromId, to: currId });
|
|
75
|
+
fromId = undefined;
|
|
76
|
+
count = 0;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
if (fromId && currId) {
|
|
80
|
+
batches.push({ from: fromId, to: currId });
|
|
81
|
+
}
|
|
82
|
+
return batches;
|
|
94
83
|
}
|
|
84
|
+
exports.getBatchedClassElementIds = getBatchedClassElementIds;
|
|
95
85
|
function createElementsFilter(elementAlias, classNames) {
|
|
96
|
-
if (classNames === undefined || classNames.length === 0)
|
|
86
|
+
if (classNames === undefined || classNames.length === 0) {
|
|
97
87
|
return undefined;
|
|
88
|
+
}
|
|
98
89
|
// check if list contains only valid class names
|
|
99
90
|
const classNameRegExp = new RegExp(/^[\w]+[.:][\w]+$/);
|
|
100
91
|
const invalidName = classNames.find((name) => !name.match(classNameRegExp));
|
|
@@ -146,8 +137,9 @@ class CategoryItemAppender {
|
|
|
146
137
|
this._items[label] = item;
|
|
147
138
|
}
|
|
148
139
|
finish() {
|
|
149
|
-
if (Object.keys(this._items).length === 0)
|
|
140
|
+
if (Object.keys(this._items).length === 0) {
|
|
150
141
|
return;
|
|
142
|
+
}
|
|
151
143
|
this._parentAppender.append(this._category.label, {
|
|
152
144
|
type: "category",
|
|
153
145
|
items: this._items,
|
|
@@ -166,10 +158,12 @@ class ArrayItemAppender {
|
|
|
166
158
|
}
|
|
167
159
|
finish() {
|
|
168
160
|
(0, core_bentley_1.assert)(this._props.valueType.valueFormat === presentation_common_1.PropertyValueFormat.Array);
|
|
169
|
-
if (this._props.valueType.memberType.valueFormat === presentation_common_1.PropertyValueFormat.Primitive)
|
|
161
|
+
if (this._props.valueType.memberType.valueFormat === presentation_common_1.PropertyValueFormat.Primitive) {
|
|
170
162
|
this._parentAppender.append(this._props.hierarchy.field.label, this.createPrimitivesArray());
|
|
171
|
-
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
172
165
|
this._parentAppender.append(this._props.hierarchy.field.label, this.createStructsArray());
|
|
166
|
+
}
|
|
173
167
|
}
|
|
174
168
|
createPrimitivesArray() {
|
|
175
169
|
return {
|
|
@@ -223,7 +217,9 @@ class ElementPropertiesBuilder {
|
|
|
223
217
|
(0, core_bentley_1.assert)(appender !== undefined);
|
|
224
218
|
return appender;
|
|
225
219
|
}
|
|
226
|
-
startContent(_props) {
|
|
220
|
+
startContent(_props) {
|
|
221
|
+
return true;
|
|
222
|
+
}
|
|
227
223
|
finishContent() { }
|
|
228
224
|
processFieldHierarchies(_props) { }
|
|
229
225
|
startItem(props) {
|
|
@@ -245,18 +241,24 @@ class ElementPropertiesBuilder {
|
|
|
245
241
|
finishCategory() {
|
|
246
242
|
this._appendersStack.pop();
|
|
247
243
|
}
|
|
248
|
-
startField(_props) {
|
|
244
|
+
startField(_props) {
|
|
245
|
+
return true;
|
|
246
|
+
}
|
|
249
247
|
finishField() { }
|
|
250
248
|
startStruct(props) {
|
|
251
249
|
this._appendersStack.push(new StructItemAppender(this._currentAppender, props));
|
|
252
250
|
return true;
|
|
253
251
|
}
|
|
254
|
-
finishStruct() {
|
|
252
|
+
finishStruct() {
|
|
253
|
+
this._appendersStack.pop().finish();
|
|
254
|
+
}
|
|
255
255
|
startArray(props) {
|
|
256
256
|
this._appendersStack.push(new ArrayItemAppender(this._currentAppender, props));
|
|
257
257
|
return true;
|
|
258
258
|
}
|
|
259
|
-
finishArray() {
|
|
259
|
+
finishArray() {
|
|
260
|
+
this._appendersStack.pop().finish();
|
|
261
|
+
}
|
|
260
262
|
processMergedValue(props) {
|
|
261
263
|
this._currentAppender.append(props.mergedField.label, {
|
|
262
264
|
type: "primitive",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElementPropertiesHelper.js","sourceRoot":"","sources":["../../../src/presentation-backend/ElementPropertiesHelper.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,sDAAyE;AACzE,oEAKoC;AAEpC,gBAAgB;AACT,MAAM,uBAAuB,GAAG,CAAC,OAA4B,EAAuB,EAAE;IAC3F,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC;QAC7C,OAAO,EAAE,CAAC;IAEZ,MAAM,OAAO,GAAG,IAAI,wBAAwB,EAAE,CAAC;IAC/C,IAAA,qCAAe,EAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAClC,OAAO,OAAO,CAAC,KAAK,CAAC;AACvB,CAAC,CAAC;AAPW,QAAA,uBAAuB,2BAOlC;AAEF,gBAAgB;AAChB,SAAgB,gBAAgB,CAAC,EAAY,EAAE,UAAqB;IAClE,MAAM,MAAM,GAAG,oBAAoB,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;IACrD,MAAM,KAAK,GAAG;;;MAGV,MAAM,CAAC,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE;GAClC,CAAC;IAEF,OAAO,EAAE,CAAC,qBAAqB,CAAC,KAAK,EAAE,CAAC,IAAoB,EAAE,EAAE;QAC9D,OAAO,IAAI,CAAC,IAAI,EAAE,KAAK,uBAAQ,CAAC,aAAa,CAAC,CA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AG,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAE7D,kBAAkB,CAAC,KAA8B;QACtD,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,KAAK,EAAE;YACpD,IAAI,EAAE,WAAW;YACjB,KAAK,EAAE,EAAE;SACV,CAAC,CAAC;IACL,CAAC;IACM,qBAAqB,CAAC,KAAiC;QAC5D,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE;YAC9C,IAAI,EAAE,WAAW;YACjB,KAAK,EAAE,KAAK,CAAC,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE;SAC5C,CAAC,CAAC;IACL,CAAC;CACF","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 { ECSqlStatement, IModelDb } from \"@itwin/core-backend\";\nimport { assert, DbResult, Id64, Id64String } from \"@itwin/core-bentley\";\nimport {\n CategoryDescription, Content, ElementProperties, ElementPropertiesItem, ElementPropertiesPrimitiveArrayPropertyItem, ElementPropertiesPropertyItem,\n ElementPropertiesStructArrayPropertyItem, IContentVisitor, Item, PresentationError, PresentationStatus, ProcessFieldHierarchiesProps, ProcessMergedValueProps,\n ProcessPrimitiveValueProps, PropertyValueFormat, StartArrayProps, StartCategoryProps, StartContentProps, StartFieldProps, StartItemProps,\n StartStructProps, traverseContent,\n} from \"@itwin/presentation-common\";\n\n/** @internal */\nexport const buildElementsProperties = (content: Content | undefined): ElementProperties[] => {\n if (!content || content.contentSet.length === 0)\n return [];\n\n const builder = new ElementPropertiesBuilder();\n traverseContent(builder, content);\n return builder.items;\n};\n\n/** @internal */\nexport function getElementsCount(db: IModelDb, classNames?: string[]) {\n const filter = createElementsFilter(\"e\", classNames);\n const query = `\n SELECT COUNT(e.ECInstanceId)\n FROM bis.Element e\n ${filter ? `WHERE ${filter}` : \"\"}\n `;\n\n return db.withPreparedStatement(query, (stmt: ECSqlStatement) => {\n return stmt.step() === DbResult.BE_SQLITE_ROW ? stmt.getValue(0).getInteger() : 0;\n });\n}\n\n/** @internal */\nexport function* iterateElementIds(db: IModelDb, classNames?: string[], limit?: number) {\n let lastElementId;\n while (true) {\n const result = queryElementIds(db, classNames, limit, lastElementId);\n yield result.ids;\n lastElementId = result.lastElementId;\n if (!lastElementId)\n break;\n }\n}\n\nfunction queryElementIds(db: IModelDb, classNames?: string[], limit?: number, lastElementId?: Id64String) {\n function createWhereClause() {\n const classFilter = createElementsFilter(\"e\", classNames);\n const elementFilter = lastElementId ? `e.ECInstanceId > ?` : undefined;\n if (!classFilter && !elementFilter)\n return \"\";\n if (classFilter && elementFilter)\n return `WHERE ${classFilter} AND ${elementFilter}`;\n return `WHERE ${classFilter ?? \"\"} ${elementFilter ?? \"\"}`;\n }\n\n const query = `\n SELECT e.ECInstanceId elId, eSchemaDef.Name || ':' || eClassDef.Name elClassName\n FROM bis.Element e\n LEFT JOIN meta.ECClassDef eClassDef ON eClassDef.ECInstanceId = e.ECClassId\n LEFT JOIN meta.ECSchemaDef eSchemaDef ON eSchemaDef.ECInstanceId = eClassDef.Schema.Id\n ${createWhereClause()}\n ORDER BY e.ECInstanceId ASC\n `;\n\n return db.withPreparedStatement(query, (stmt: ECSqlStatement) => {\n if (lastElementId)\n stmt.bindId(1, lastElementId);\n\n const ids = new Map<string, string[]>();\n let currentClassName = \"\";\n let currentIds: string[] = [];\n let loadedIds = 0;\n while (stmt.step() === DbResult.BE_SQLITE_ROW) {\n const row = stmt.getRow();\n if (!row.elId || !row.elClassName)\n continue;\n\n if (currentClassName !== row.elClassName) {\n currentClassName = row.elClassName;\n const existingIds = ids.get(row.elClassName);\n if (!existingIds) {\n currentIds = [];\n ids.set(row.elClassName, currentIds);\n } else {\n currentIds = existingIds;\n }\n }\n currentIds.push(row.elId);\n loadedIds++;\n if (limit && loadedIds >= limit)\n return { ids, lastElementId: row.elId };\n }\n return { ids, lastElementId: undefined };\n });\n}\n\nfunction createElementsFilter(elementAlias: string, classNames?: string[]) {\n if (classNames === undefined || classNames.length === 0)\n return undefined;\n\n // check if list contains only valid class names\n const classNameRegExp = new RegExp(/^[\\w]+[.:][\\w]+$/);\n const invalidName = classNames.find((name) => !name.match(classNameRegExp));\n if (invalidName) {\n throw new PresentationError(PresentationStatus.InvalidArgument, `Encountered invalid class name - ${invalidName}.\n Valid class name formats: \"<schema name or alias>.<class name>\", \"<schema name or alias>:<class name>\"`);\n }\n\n return `${elementAlias}.ECClassId IS (${classNames.join(\",\")})`;\n}\n\ninterface IPropertiesAppender {\n append(label: string, item: ElementPropertiesItem): void;\n finish(): void;\n}\n\nclass ElementPropertiesAppender implements IPropertiesAppender {\n private _propertyItems: { [label: string]: ElementPropertiesItem } = {};\n private _categoryItemAppenders: { [categoryName: string]: IPropertiesAppender } = {};\n constructor(private _item: Item, private _onItemFinished: (item: ElementProperties) => void) { }\n\n public append(label: string, item: ElementPropertiesItem): void {\n this._propertyItems[label] = item;\n }\n\n public finish(): void {\n // eslint-disable-next-line guard-for-in\n for (const categoryName in this._categoryItemAppenders) {\n const appender = this._categoryItemAppenders[categoryName];\n appender.finish();\n }\n\n this._onItemFinished({\n class: this._item.classInfo?.label ?? \"\",\n id: this._item.primaryKeys[0]?.id ?? Id64.invalid,\n label: this._item.label.displayValue,\n items: this._propertyItems,\n });\n }\n\n public getCategoryAppender(parentAppender: IPropertiesAppender, category: CategoryDescription): IPropertiesAppender {\n let appender = this._categoryItemAppenders[category.name];\n if (!appender) {\n appender = new CategoryItemAppender(parentAppender, category);\n this._categoryItemAppenders[category.name] = appender;\n }\n return appender;\n }\n}\n\nclass CategoryItemAppender implements IPropertiesAppender {\n private _items: { [label: string]: ElementPropertiesItem } = {};\n constructor(private _parentAppender: IPropertiesAppender, private _category: CategoryDescription) { }\n public append(label: string, item: ElementPropertiesItem): void {\n this._items[label] = item;\n }\n public finish(): void {\n if (Object.keys(this._items).length === 0)\n return;\n\n this._parentAppender.append(this._category.label, {\n type: \"category\",\n items: this._items,\n });\n }\n}\n\nclass ArrayItemAppender implements IPropertiesAppender {\n private _items: ElementPropertiesPropertyItem[] = [];\n constructor(private _parentAppender: IPropertiesAppender, private _props: StartArrayProps) { }\n public append(_label: string, item: ElementPropertiesItem): void {\n assert(item.type !== \"category\");\n this._items.push(item);\n }\n public finish(): void {\n assert(this._props.valueType.valueFormat === PropertyValueFormat.Array);\n if (this._props.valueType.memberType.valueFormat === PropertyValueFormat.Primitive)\n this._parentAppender.append(this._props.hierarchy.field.label, this.createPrimitivesArray());\n else\n this._parentAppender.append(this._props.hierarchy.field.label, this.createStructsArray());\n }\n private createPrimitivesArray(): ElementPropertiesPrimitiveArrayPropertyItem {\n return {\n type: \"array\",\n valueType: \"primitive\",\n values: this._items.map((item) => {\n assert(item.type === \"primitive\");\n return item.value;\n }),\n };\n }\n private createStructsArray(): ElementPropertiesStructArrayPropertyItem {\n return {\n type: \"array\",\n valueType: \"struct\",\n values: this._items.map((item) => {\n assert(item.type === \"struct\");\n return item.members;\n }),\n };\n }\n}\n\nclass StructItemAppender implements IPropertiesAppender {\n private _members: { [label: string]: ElementPropertiesPropertyItem } = {};\n constructor(private _parentAppender: IPropertiesAppender, private _props: StartStructProps) { }\n public append(label: string, item: ElementPropertiesItem): void {\n assert(item.type !== \"category\");\n this._members[label] = item;\n }\n public finish(): void {\n assert(this._props.valueType.valueFormat === PropertyValueFormat.Struct);\n this._parentAppender.append(this._props.hierarchy.field.label, {\n type: \"struct\",\n members: this._members,\n });\n }\n}\n\nclass ElementPropertiesBuilder implements IContentVisitor {\n private _appendersStack: IPropertiesAppender[] = [];\n private _items: ElementProperties[] = [];\n private _elementPropertiesAppender: ElementPropertiesAppender | undefined;\n\n public get items(): ElementProperties[] {\n return this._items;\n }\n\n private get _currentAppender(): IPropertiesAppender {\n const appender = this._appendersStack[this._appendersStack.length - 1];\n assert(appender !== undefined);\n return appender;\n }\n\n public startContent(_props: StartContentProps): boolean { return true; }\n public finishContent(): void { }\n\n public processFieldHierarchies(_props: ProcessFieldHierarchiesProps): void { }\n\n public startItem(props: StartItemProps): boolean {\n this._elementPropertiesAppender = new ElementPropertiesAppender(props.item, (item) => this._items.push(item));\n this._appendersStack.push(this._elementPropertiesAppender);\n return true;\n }\n public finishItem(): void {\n this._appendersStack.pop();\n assert(this._elementPropertiesAppender !== undefined);\n this._elementPropertiesAppender.finish();\n this._elementPropertiesAppender = undefined;\n }\n\n public startCategory(props: StartCategoryProps): boolean {\n assert(this._elementPropertiesAppender !== undefined);\n this._appendersStack.push(this._elementPropertiesAppender.getCategoryAppender(this._currentAppender, props.category));\n return true;\n }\n public finishCategory(): void {\n this._appendersStack.pop();\n }\n\n public startField(_props: StartFieldProps): boolean { return true; }\n public finishField(): void { }\n\n public startStruct(props: StartStructProps): boolean {\n this._appendersStack.push(new StructItemAppender(this._currentAppender, props));\n return true;\n }\n public finishStruct(): void { this._appendersStack.pop()!.finish(); }\n\n public startArray(props: StartArrayProps): boolean {\n this._appendersStack.push(new ArrayItemAppender(this._currentAppender, props));\n return true;\n }\n public finishArray(): void { this._appendersStack.pop()!.finish(); }\n\n public processMergedValue(props: ProcessMergedValueProps): void {\n this._currentAppender.append(props.mergedField.label, {\n type: \"primitive\",\n value: \"\",\n });\n }\n public processPrimitiveValue(props: ProcessPrimitiveValueProps): void {\n this._currentAppender.append(props.field.label, {\n type: \"primitive\",\n value: props.displayValue?.toString() ?? \"\",\n });\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ElementPropertiesHelper.js","sourceRoot":"","sources":["../../../src/presentation-backend/ElementPropertiesHelper.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,+BAAoE;AAEpE,sDAAyE;AACzE,oEAuBoC;AAEpC,gBAAgB;AACT,MAAM,sBAAsB,GAAG,CAAC,UAAsB,EA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AC;IAEM,UAAU,CAAC,MAAuB;QACvC,OAAO,IAAI,CAAC;IACd,CAAC;IACM,WAAW,KAAU,CAAC;IAEtB,WAAW,CAAC,KAAuB;QACxC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,kBAAkB,CAAC,IAAI,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC,CAAC;QAChF,OAAO,IAAI,CAAC;IACd,CAAC;IACM,YAAY;QACjB,IAAI,CAAC,eAAe,CAAC,GAAG,EAAG,CAAC,MAAM,EAAE,CAAC;IACvC,CAAC;IAEM,UAAU,CAAC,KAAsB;QACtC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,iBAAiB,CAAC,IAAI,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC,CAAC;QAC/E,OAAO,IAAI,CAAC;IACd,CAAC;IACM,WAAW;QAChB,IAAI,CAAC,eAAe,CAAC,GAAG,EAAG,CAAC,MAAM,EAAE,CAAC;IACvC,CAAC;IAEM,kBAAkB,CAAC,KAA8B;QACtD,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,KAAK,EAAE;YACpD,IAAI,EAAE,WAAW;YACjB,KAAK,EAAE,EAAE;SACV,CAAC,CAAC;IACL,CAAC;IACM,qBAAqB,CAAC,KAAiC;QAC5D,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE;YAC9C,IAAI,EAAE,WAAW;YACjB,KAAK,EAAE,KAAK,CAAC,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE;SAC5C,CAAC,CAAC;IACL,CAAC;CACF","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 { from, mergeAll, mergeMap, Observable, reduce } from \"rxjs\";\nimport { ECSqlStatement, IModelDb } from \"@itwin/core-backend\";\nimport { assert, DbResult, Id64, Id64String } from \"@itwin/core-bentley\";\nimport {\n CategoryDescription,\n Descriptor,\n ElementProperties,\n ElementPropertiesItem,\n ElementPropertiesPrimitiveArrayPropertyItem,\n ElementPropertiesPropertyItem,\n ElementPropertiesStructArrayPropertyItem,\n IContentVisitor,\n Item,\n PresentationError,\n PresentationStatus,\n ProcessFieldHierarchiesProps,\n ProcessMergedValueProps,\n ProcessPrimitiveValueProps,\n PropertyValueFormat,\n StartArrayProps,\n StartCategoryProps,\n StartContentProps,\n StartFieldProps,\n StartItemProps,\n StartStructProps,\n traverseContentItem,\n} from \"@itwin/presentation-common\";\n\n/** @internal */\nexport const buildElementProperties = (descriptor: Descriptor, item: Item): ElementProperties => {\n const builder = new ElementPropertiesBuilder();\n traverseContentItem(builder, descriptor, item);\n return builder.items[0];\n};\n\n/** @internal */\nexport function getElementsCount(db: IModelDb, classNames?: string[]) {\n const filter = createElementsFilter(\"e\", classNames);\n const query = `\n SELECT COUNT(e.ECInstanceId)\n FROM bis.Element e\n ${filter ? `WHERE ${filter}` : \"\"}\n `;\n\n return db.withPreparedStatement(query, (stmt: ECSqlStatement) => {\n return stmt.step() === DbResult.BE_SQLITE_ROW ? stmt.getValue(0).getInteger() : 0;\n });\n}\n\n/** @internal */\nexport function parseFullClassName(fullClassName: string): [string, string] {\n const [schemaName, className] = fullClassName.split(/[:\\.]/);\n return [schemaName, className];\n}\n\nfunction getECSqlName(fullClassName: string) {\n const [schemaName, className] = parseFullClassName(fullClassName);\n return `[${schemaName}].[${className}]`;\n}\n\n/** @internal */\nexport function getClassesWithInstances(imodel: IModelDb, fullClassNames: string[]): Observable<string> {\n return from(fullClassNames).pipe(\n mergeMap((fullClassName) => {\n const reader = imodel.createQueryReader(`\n SELECT s.Name, c.Name\n FROM ${getECSqlName(fullClassName)} e\n JOIN meta.ECClassDef c ON c.ECInstanceId = e.ECClassId\n JOIN meta.ECSchemaDef s on s.ECInstanceId = c.Schema.Id\n GROUP BY c.ECInstanceId\n `);\n return from(reader.toArray() as Promise<[string, string][]>);\n }),\n mergeAll(),\n reduce<[string, string], Set<string>>((set, [schemaName, className]) => {\n set.add(`${schemaName}.${className}`);\n return set;\n }, new Set()),\n mergeMap((set) => [...set]),\n );\n}\n\n/** @internal */\nexport async function getBatchedClassElementIds(\n imodel: IModelDb,\n fullClassName: string,\n batchSize: number,\n): Promise<Array<{ from: Id64String, to: Id64String }>> {\n const batches = [];\n const reader = imodel.createQueryReader(`SELECT ECInstanceId id FROM ${getECSqlName(fullClassName)} ORDER BY ECInstanceId`);\n let currId: Id64String | undefined;\n let fromId: Id64String | undefined;\n let count = 0;\n while (await reader.step()) {\n currId = reader.current.toRow().id as Id64String;\n if (!fromId) {\n fromId = currId;\n }\n if (++count >= batchSize) {\n batches.push({ from: fromId, to: currId });\n fromId = undefined;\n count = 0;\n }\n }\n if (fromId && currId) {\n batches.push({ from: fromId, to: currId });\n }\n return batches;\n}\n\nfunction createElementsFilter(elementAlias: string, classNames?: string[]) {\n if (classNames === undefined || classNames.length === 0) {\n return undefined;\n }\n\n // check if list contains only valid class names\n const classNameRegExp = new RegExp(/^[\\w]+[.:][\\w]+$/);\n const invalidName = classNames.find((name) => !name.match(classNameRegExp));\n if (invalidName) {\n throw new PresentationError(\n PresentationStatus.InvalidArgument,\n `Encountered invalid class name - ${invalidName}.\n Valid class name formats: \"<schema name or alias>.<class name>\", \"<schema name or alias>:<class name>\"`,\n );\n }\n\n return `${elementAlias}.ECClassId IS (${classNames.join(\",\")})`;\n}\n\ninterface IPropertiesAppender {\n append(label: string, item: ElementPropertiesItem): void;\n finish(): void;\n}\n\nclass ElementPropertiesAppender implements IPropertiesAppender {\n private _propertyItems: { [label: string]: ElementPropertiesItem } = {};\n private _categoryItemAppenders: { [categoryName: string]: IPropertiesAppender } = {};\n constructor(private _item: Item, private _onItemFinished: (item: ElementProperties) => void) {}\n\n public append(label: string, item: ElementPropertiesItem): void {\n this._propertyItems[label] = item;\n }\n\n public finish(): void {\n // eslint-disable-next-line guard-for-in\n for (const categoryName in this._categoryItemAppenders) {\n const appender = this._categoryItemAppenders[categoryName];\n appender.finish();\n }\n\n this._onItemFinished({\n class: this._item.classInfo?.label ?? \"\",\n id: this._item.primaryKeys[0]?.id ?? Id64.invalid,\n label: this._item.label.displayValue,\n items: this._propertyItems,\n });\n }\n\n public getCategoryAppender(parentAppender: IPropertiesAppender, category: CategoryDescription): IPropertiesAppender {\n let appender = this._categoryItemAppenders[category.name];\n if (!appender) {\n appender = new CategoryItemAppender(parentAppender, category);\n this._categoryItemAppenders[category.name] = appender;\n }\n return appender;\n }\n}\n\nclass CategoryItemAppender implements IPropertiesAppender {\n private _items: { [label: string]: ElementPropertiesItem } = {};\n constructor(private _parentAppender: IPropertiesAppender, private _category: CategoryDescription) {}\n public append(label: string, item: ElementPropertiesItem): void {\n this._items[label] = item;\n }\n public finish(): void {\n if (Object.keys(this._items).length === 0) {\n return;\n }\n\n this._parentAppender.append(this._category.label, {\n type: \"category\",\n items: this._items,\n });\n }\n}\n\nclass ArrayItemAppender implements IPropertiesAppender {\n private _items: ElementPropertiesPropertyItem[] = [];\n constructor(private _parentAppender: IPropertiesAppender, private _props: StartArrayProps) {}\n public append(_label: string, item: ElementPropertiesItem): void {\n assert(item.type !== \"category\");\n this._items.push(item);\n }\n public finish(): void {\n assert(this._props.valueType.valueFormat === PropertyValueFormat.Array);\n if (this._props.valueType.memberType.valueFormat === PropertyValueFormat.Primitive) {\n this._parentAppender.append(this._props.hierarchy.field.label, this.createPrimitivesArray());\n } else {\n this._parentAppender.append(this._props.hierarchy.field.label, this.createStructsArray());\n }\n }\n private createPrimitivesArray(): ElementPropertiesPrimitiveArrayPropertyItem {\n return {\n type: \"array\",\n valueType: \"primitive\",\n values: this._items.map((item) => {\n assert(item.type === \"primitive\");\n return item.value;\n }),\n };\n }\n private createStructsArray(): ElementPropertiesStructArrayPropertyItem {\n return {\n type: \"array\",\n valueType: \"struct\",\n values: this._items.map((item) => {\n assert(item.type === \"struct\");\n return item.members;\n }),\n };\n }\n}\n\nclass StructItemAppender implements IPropertiesAppender {\n private _members: { [label: string]: ElementPropertiesPropertyItem } = {};\n constructor(private _parentAppender: IPropertiesAppender, private _props: StartStructProps) {}\n public append(label: string, item: ElementPropertiesItem): void {\n assert(item.type !== \"category\");\n this._members[label] = item;\n }\n public finish(): void {\n assert(this._props.valueType.valueFormat === PropertyValueFormat.Struct);\n this._parentAppender.append(this._props.hierarchy.field.label, {\n type: \"struct\",\n members: this._members,\n });\n }\n}\n\nclass ElementPropertiesBuilder implements IContentVisitor {\n private _appendersStack: IPropertiesAppender[] = [];\n private _items: ElementProperties[] = [];\n private _elementPropertiesAppender: ElementPropertiesAppender | undefined;\n\n public get items(): ElementProperties[] {\n return this._items;\n }\n\n private get _currentAppender(): IPropertiesAppender {\n const appender = this._appendersStack[this._appendersStack.length - 1];\n assert(appender !== undefined);\n return appender;\n }\n\n public startContent(_props: StartContentProps): boolean {\n return true;\n }\n public finishContent(): void {}\n\n public processFieldHierarchies(_props: ProcessFieldHierarchiesProps): void {}\n\n public startItem(props: StartItemProps): boolean {\n this._elementPropertiesAppender = new ElementPropertiesAppender(props.item, (item) => this._items.push(item));\n this._appendersStack.push(this._elementPropertiesAppender);\n return true;\n }\n public finishItem(): void {\n this._appendersStack.pop();\n assert(this._elementPropertiesAppender !== undefined);\n this._elementPropertiesAppender.finish();\n this._elementPropertiesAppender = undefined;\n }\n\n public startCategory(props: StartCategoryProps): boolean {\n assert(this._elementPropertiesAppender !== undefined);\n this._appendersStack.push(this._elementPropertiesAppender.getCategoryAppender(this._currentAppender, props.category));\n return true;\n }\n public finishCategory(): void {\n this._appendersStack.pop();\n }\n\n public startField(_props: StartFieldProps): boolean {\n return true;\n }\n public finishField(): void {}\n\n public startStruct(props: StartStructProps): boolean {\n this._appendersStack.push(new StructItemAppender(this._currentAppender, props));\n return true;\n }\n public finishStruct(): void {\n this._appendersStack.pop()!.finish();\n }\n\n public startArray(props: StartArrayProps): boolean {\n this._appendersStack.push(new ArrayItemAppender(this._currentAppender, props));\n return true;\n }\n public finishArray(): void {\n this._appendersStack.pop()!.finish();\n }\n\n public processMergedValue(props: ProcessMergedValueProps): void {\n this._currentAppender.append(props.mergedField.label, {\n type: \"primitive\",\n value: \"\",\n });\n }\n public processPrimitiveValue(props: ProcessPrimitiveValueProps): void {\n this._currentAppender.append(props.field.label, {\n type: \"primitive\",\n value: props.displayValue?.toString() ?? \"\",\n });\n }\n}\n"]}
|
|
@@ -17,6 +17,7 @@ export declare enum NativePlatformRequestTypes {
|
|
|
17
17
|
GetContentSources = "GetContentSources",
|
|
18
18
|
GetContentDescriptor = "GetContentDescriptor",
|
|
19
19
|
GetContentSetSize = "GetContentSetSize",
|
|
20
|
+
GetContentSet = "GetContentSet",
|
|
20
21
|
GetContent = "GetContent",
|
|
21
22
|
GetPagedDistinctValues = "GetPagedDistinctValues",
|
|
22
23
|
GetDisplayLabel = "GetDisplayLabel",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativePlatform.d.ts","sourceRoot":"","sources":["../../../src/presentation-backend/NativePlatform.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAc,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EAAU,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EACL,oBAAoB,EAAE,OAAO,EAAE,iBAAiB,EAAsB,UAAU,EAAE,aAAa,EAAqB,kBAAkB,EACvI,MAAM,4BAA4B,CAAC;AAGpC,gBAAgB;AAChB,oBAAY,0BAA0B;IACpC,YAAY,iBAAiB;IAC7B,iBAAiB,sBAAsB;IACvC,WAAW,gBAAgB;IAC3B,gBAAgB,qBAAqB;IACrC,kBAAkB,uBAAuB;IACzC,YAAY,iBAAiB;IA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eAAO,MAAM,2BAA2B,UAAW,0BAA0B,KAAG,UAAU,wBA+FzF,CAAC"}
|
|
@@ -25,6 +25,7 @@ var NativePlatformRequestTypes;
|
|
|
25
25
|
NativePlatformRequestTypes["GetContentSources"] = "GetContentSources";
|
|
26
26
|
NativePlatformRequestTypes["GetContentDescriptor"] = "GetContentDescriptor";
|
|
27
27
|
NativePlatformRequestTypes["GetContentSetSize"] = "GetContentSetSize";
|
|
28
|
+
NativePlatformRequestTypes["GetContentSet"] = "GetContentSet";
|
|
28
29
|
NativePlatformRequestTypes["GetContent"] = "GetContent";
|
|
29
30
|
NativePlatformRequestTypes["GetPagedDistinctValues"] = "GetPagedDistinctValues";
|
|
30
31
|
NativePlatformRequestTypes["GetDisplayLabel"] = "GetDisplayLabel";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativePlatform.js","sourceRoot":"","sources":["../../../src/presentation-backend/NativePlatform.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA2E;AAC3E,sDAAmE;AAEnE,oEAEoC;AACpC,+DAA2D;AAE3D,gBAAgB;AAChB,IAAY,0BAeX;AAfD,WAAY,0BAA0B;IACpC,2DAA6B,CAAA;IAC7B,qEAAuC,CAAA;IACvC,yDAA2B,CAAA;IAC3B,mEAAqC,CAAA;IACrC,uEAAyC,CAAA;IACzC,2DAA6B,CAAA;IAC7B,2EAA6C,CAAA;IAC7C,qEAAuC,CAAA;IACvC,2EAA6C,CAAA;IAC7C,qEAAuC,CAAA;IACvC,uDAAyB,CAAA;IACzB,+EAAiD,CAAA;IACjD,iEAAmC,CAAA;IACnC,uEAAyC,CAAA;AAC3C,CAAC,EAfW,0BAA0B,GAA1B,kCAA0B,KAA1B,kCAA0B,QAerC;AAED;;;GAGG;AACH,IAAY,4BAKX;AALD,WAAY,4BAA4B;IACtC,iDAAiB,CAAA;IACjB,oEAAoC,CAAA;IACpC,4DAA4B,CAAA;IAC5B,sDAAsB,CAA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G,CAAC;QACM,yBAAyB,CAAC,SAAiB,EAAE,UAAkB;YACpE,OAAO,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,YAAY,CAAC,yBAAyB,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;QACnG,CAAC;QACM,aAAa;YAClB,OAAO,IAAI,CAAC,YAAY,CAAyB,IAAI,CAAC,YAAY,CAAC,aAAa,EAAE,CAAC,CAAC;QACtF,CAAC;KACF,CAAC;AACJ,CAAC,CAAC;AA/FW,QAAA,2BAA2B,+BA+FtC","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 { IModelDb, IModelHost, IModelJsNative } from \"@itwin/core-backend\";\nimport { assert, BeEvent, IDisposable } from \"@itwin/core-bentley\";\nimport { FormatProps } from \"@itwin/core-quantity\";\nimport {\n DiagnosticsScopeLogs, NodeKey, PresentationError, PresentationStatus, UpdateInfo, VariableValue, VariableValueJSON, VariableValueTypes,\n} from \"@itwin/presentation-common\";\nimport { HierarchyCacheMode } from \"./PresentationManager\";\n\n/** @internal */\nexport enum NativePlatformRequestTypes {\n GetRootNodes = \"GetRootNodes\",\n GetRootNodesCount = \"GetRootNodesCount\",\n GetChildren = \"GetChildren\",\n GetChildrenCount = \"GetChildrenCount\",\n GetNodesDescriptor = \"GetNodesDescriptor\",\n GetNodePaths = \"GetNodePaths\",\n GetFilteredNodePaths = \"GetFilteredNodePaths\",\n GetContentSources = \"GetContentSources\",\n GetContentDescriptor = \"GetContentDescriptor\",\n GetContentSetSize = \"GetContentSetSize\",\n GetContent = \"GetContent\",\n GetPagedDistinctValues = \"GetPagedDistinctValues\",\n GetDisplayLabel = \"GetDisplayLabel\",\n CompareHierarchies = \"CompareHierarchies\",\n}\n\n/**\n * Enumeration of unit systems supported by native presentation manager.\n * @internal\n */\nexport enum NativePresentationUnitSystem {\n Metric = \"metric\",\n BritishImperial = \"british-imperial\",\n UsCustomary = \"us-customary\",\n UsSurvey = \"us-survey\",\n}\n\n/** @internal */\nexport interface NativePresentationDefaultUnitFormats {\n [phenomenon: string]: Array<{\n unitSystems: NativePresentationUnitSystem[];\n format: FormatProps;\n }>;\n}\n\n/** @internal */\nexport interface NativePresentationKeySetJSON {\n instanceKeys: Array<[string, string[]]>;\n nodeKeys: NodeKey[];\n}\n\n/** @internal */\nexport interface NativePlatformResponse<TResult> {\n result: TResult;\n diagnostics?: DiagnosticsScopeLogs;\n}\n\n/** @internal */\nexport interface NativePlatformDefinition extends IDisposable {\n getImodelAddon(imodel: IModelDb): any;\n\n setupRulesetDirectories(directories: string[]): NativePlatformResponse<void>;\n setupSupplementalRulesetDirectories(directories: string[]): NativePlatformResponse<void>;\n\n forceLoadSchemas(db: any): Promise<NativePlatformResponse<void>>;\n\n registerSupplementalRuleset(serializedRulesetJson: string): NativePlatformResponse<string>;\n getRulesets(rulesetId: string): NativePlatformResponse<string>;\n addRuleset(serializedRulesetJson: string): NativePlatformResponse<string>;\n removeRuleset(rulesetId: string, hash: string): NativePlatformResponse<boolean>;\n clearRulesets(): NativePlatformResponse<void>;\n\n handleRequest(db: any, options: string, cancelEvent?: BeEvent<() => void>): Promise<NativePlatformResponse<string>>;\n\n getRulesetVariableValue(rulesetId: string, variableId: string, type: VariableValueTypes): NativePlatformResponse<VariableValue>;\n setRulesetVariableValue(rulesetId: string, variableId: string, type: VariableValueTypes, value: VariableValue): NativePlatformResponse<void>;\n unsetRulesetVariableValue(rulesetId: string, variableId: string): NativePlatformResponse<void>;\n\n getUpdateInfo(): NativePlatformResponse<UpdateInfo | undefined>;\n}\n\n/** @internal */\nexport interface DefaultNativePlatformProps {\n id: string;\n taskAllocationsMap: { [priority: number]: number };\n isChangeTrackingEnabled: boolean;\n cacheConfig?: IModelJsNative.ECPresentationHierarchyCacheConfig;\n contentCacheSize?: number;\n workerConnectionCacheSize?: number;\n defaultFormats?: NativePresentationDefaultUnitFormats;\n useMmap?: boolean | number;\n}\n\n/** @internal */\nexport class PresentationNativePlatformResponseError extends PresentationError {\n public readonly diagnostics?: DiagnosticsScopeLogs;\n public constructor(errorResponse: IModelJsNative.ECPresentationManagerResponse<unknown>) {\n assert(!!errorResponse.error);\n super(getPresentationStatusFromNativeResponseStatus(errorResponse.error.status), errorResponse.error.message);\n this.diagnostics = errorResponse.diagnostics;\n }\n}\n\nfunction getPresentationStatusFromNativeResponseStatus(nativeResponseStatus: IModelJsNative.ECPresentationStatus): PresentationStatus {\n switch (nativeResponseStatus) {\n case IModelJsNative.ECPresentationStatus.InvalidArgument: return PresentationStatus.InvalidArgument;\n case IModelJsNative.ECPresentationStatus.ResultSetTooLarge: return PresentationStatus.ResultSetTooLarge;\n case IModelJsNative.ECPresentationStatus.Canceled: return PresentationStatus.Canceled;\n }\n return PresentationStatus.Error;\n}\n\n/** @internal */\nexport const createDefaultNativePlatform = (props: DefaultNativePlatformProps): new () => NativePlatformDefinition => {\n // note the implementation is constructed here to make PresentationManager\n // usable without loading the actual addon (if addon is set to something other)\n return class implements NativePlatformDefinition {\n private _nativeAddon: IModelJsNative.ECPresentationManager;\n public constructor() {\n const cacheConfig = props.cacheConfig ?? { mode: HierarchyCacheMode.Disk, directory: \"\" };\n const defaultFormats = props.defaultFormats ? this.getSerializedDefaultFormatsMap(props.defaultFormats) : {};\n this._nativeAddon = new IModelHost.platform.ECPresentationManager({ ...props, cacheConfig, defaultFormats });\n }\n private getSerializedDefaultFormatsMap(defaultMap: NativePresentationDefaultUnitFormats) {\n const res: {\n [phenomenon: string]: Array<{\n unitSystems: string[];\n serializedFormat: string;\n }>;\n } = {};\n Object.entries(defaultMap).forEach(([phenomenon, formats]) => {\n res[phenomenon] = formats.map((value) => ({ unitSystems: value.unitSystems, serializedFormat: JSON.stringify(value.format) }));\n });\n return res;\n }\n private createSuccessResponse<T>(response: IModelJsNative.ECPresentationManagerResponse<T>): NativePlatformResponse<T> {\n const retValue: NativePlatformResponse<T> = { result: response.result! };\n if (response.diagnostics)\n retValue.diagnostics = response.diagnostics;\n return retValue;\n }\n private handleResult<T>(response: IModelJsNative.ECPresentationManagerResponse<T>): NativePlatformResponse<T> {\n if (response.error)\n throw new PresentationNativePlatformResponseError(response);\n return this.createSuccessResponse(response);\n }\n private handleConvertedResult<TSource, TTarget>(response: IModelJsNative.ECPresentationManagerResponse<TSource>, conv: (s: TSource) => TTarget): NativePlatformResponse<TTarget> {\n return this.handleResult<TTarget>((response.result ? { ...response, result: conv(response.result) } : response) as IModelJsNative.ECPresentationManagerResponse<TTarget>);\n }\n private handleVoidResult(response: IModelJsNative.ECPresentationManagerResponse<void>): NativePlatformResponse<void> {\n if (response.error)\n throw new PresentationNativePlatformResponseError(response);\n return this.createSuccessResponse(response);\n }\n public dispose() {\n this._nativeAddon.dispose();\n }\n public async forceLoadSchemas(db: any): Promise<NativePlatformResponse<void>> {\n const response = await this._nativeAddon.forceLoadSchemas(db);\n if (response.error)\n throw new PresentationError(PresentationStatus.Error, response.error.message);\n return this.createSuccessResponse(response);\n }\n public setupRulesetDirectories(directories: string[]) {\n return this.handleVoidResult(this._nativeAddon.setupRulesetDirectories(directories));\n }\n public setupSupplementalRulesetDirectories(directories: string[]) {\n return this.handleVoidResult(this._nativeAddon.setupSupplementalRulesetDirectories(directories));\n }\n public getImodelAddon(imodel: IModelDb): any {\n if (!imodel.isOpen)\n throw new PresentationError(PresentationStatus.InvalidArgument, \"imodel\");\n return imodel.nativeDb;\n }\n public registerSupplementalRuleset(serializedRulesetJson: string) {\n return this.handleResult<string>(this._nativeAddon.registerSupplementalRuleset(serializedRulesetJson));\n }\n public getRulesets(rulesetId: string) {\n return this.handleResult<string>(this._nativeAddon.getRulesets(rulesetId));\n }\n public addRuleset(serializedRulesetJson: string) {\n return this.handleResult<string>(this._nativeAddon.addRuleset(serializedRulesetJson));\n }\n public removeRuleset(rulesetId: string, hash: string) {\n return this.handleResult<boolean>(this._nativeAddon.removeRuleset(rulesetId, hash));\n }\n public clearRulesets() {\n return this.handleVoidResult(this._nativeAddon.clearRulesets());\n }\n public async handleRequest(db: any, options: string, cancelEvent?: BeEvent<() => void>) {\n const response = this._nativeAddon.handleRequest(db, options);\n cancelEvent?.addOnce(() => response.cancel());\n const result = await response.result;\n return this.handleConvertedResult<Buffer, string>(result, (buffer) => buffer.toString());\n }\n public getRulesetVariableValue(rulesetId: string, variableId: string, type: VariableValueTypes) {\n return this.handleResult<VariableValue>(this._nativeAddon.getRulesetVariableValue(rulesetId, variableId, type));\n }\n public setRulesetVariableValue(rulesetId: string, variableId: string, type: VariableValueTypes, value: VariableValueJSON) {\n return this.handleVoidResult(this._nativeAddon.setRulesetVariableValue(rulesetId, variableId, type, value));\n }\n public unsetRulesetVariableValue(rulesetId: string, variableId: string) {\n return this.handleVoidResult(this._nativeAddon.unsetRulesetVariableValue(rulesetId, variableId));\n }\n public getUpdateInfo() {\n return this.handleResult<UpdateInfo | undefined>(this._nativeAddon.getUpdateInfo());\n }\n };\n};\n"]}
|
|
1
|
+
{"version":3,"file":"NativePlatform.js","sourceRoot":"","sources":["../../../src/presentation-backend/NativePlatform.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA2E;AAC3E,sDAAmE;AAEnE,oEAEoC;AACpC,+DAA2D;AAE3D,gBAAgB;AAChB,IAAY,0BAgBX;AAhBD,WAAY,0BAA0B;IACpC,2DAA6B,CAAA;IAC7B,qEAAuC,CAAA;IACvC,yDAA2B,CAAA;IAC3B,mEAAqC,CAAA;IACrC,uEAAyC,CAAA;IACzC,2DAA6B,CAAA;IAC7B,2EAA6C,CAAA;IAC7C,qEAAuC,CAAA;IACvC,2EAA6C,CAAA;IAC7C,qEAAuC,CAAA;IACvC,6DAA+B,CAAA;IAC/B,uDAAyB,CAAA;IACzB,+EAAiD,CAAA;IACjD,iEAAmC,CAAA;IACnC,uEAAyC,CAAA;AAC3C,CAAC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AAiB,EAAE,UAAkB,EAAE,IAAwB,EAAE,KAAwB;YACtH,OAAO,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,YAAY,CAAC,uBAAuB,CAAC,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;QAC9G,CAAC;QACM,yBAAyB,CAAC,SAAiB,EAAE,UAAkB;YACpE,OAAO,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,YAAY,CAAC,yBAAyB,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;QACnG,CAAC;QACM,aAAa;YAClB,OAAO,IAAI,CAAC,YAAY,CAAyB,IAAI,CAAC,YAAY,CAAC,aAAa,EAAE,CAAC,CAAC;QACtF,CAAC;KACF,CAAC;AACJ,CAAC,CAAC;AA/FW,QAAA,2BAA2B,+BA+FtC","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 { IModelDb, IModelHost, IModelJsNative } from \"@itwin/core-backend\";\nimport { assert, BeEvent, IDisposable } from \"@itwin/core-bentley\";\nimport { FormatProps } from \"@itwin/core-quantity\";\nimport {\n DiagnosticsScopeLogs, NodeKey, PresentationError, PresentationStatus, UpdateInfo, VariableValue, VariableValueJSON, VariableValueTypes,\n} from \"@itwin/presentation-common\";\nimport { HierarchyCacheMode } from \"./PresentationManager\";\n\n/** @internal */\nexport enum NativePlatformRequestTypes {\n GetRootNodes = \"GetRootNodes\",\n GetRootNodesCount = \"GetRootNodesCount\",\n GetChildren = \"GetChildren\",\n GetChildrenCount = \"GetChildrenCount\",\n GetNodesDescriptor = \"GetNodesDescriptor\",\n GetNodePaths = \"GetNodePaths\",\n GetFilteredNodePaths = \"GetFilteredNodePaths\",\n GetContentSources = \"GetContentSources\",\n GetContentDescriptor = \"GetContentDescriptor\",\n GetContentSetSize = \"GetContentSetSize\",\n GetContentSet = \"GetContentSet\",\n GetContent = \"GetContent\",\n GetPagedDistinctValues = \"GetPagedDistinctValues\",\n GetDisplayLabel = \"GetDisplayLabel\",\n CompareHierarchies = \"CompareHierarchies\",\n}\n\n/**\n * Enumeration of unit systems supported by native presentation manager.\n * @internal\n */\nexport enum NativePresentationUnitSystem {\n Metric = \"metric\",\n BritishImperial = \"british-imperial\",\n UsCustomary = \"us-customary\",\n UsSurvey = \"us-survey\",\n}\n\n/** @internal */\nexport interface NativePresentationDefaultUnitFormats {\n [phenomenon: string]: Array<{\n unitSystems: NativePresentationUnitSystem[];\n format: FormatProps;\n }>;\n}\n\n/** @internal */\nexport interface NativePresentationKeySetJSON {\n instanceKeys: Array<[string, string[]]>;\n nodeKeys: NodeKey[];\n}\n\n/** @internal */\nexport interface NativePlatformResponse<TResult> {\n result: TResult;\n diagnostics?: DiagnosticsScopeLogs;\n}\n\n/** @internal */\nexport interface NativePlatformDefinition extends IDisposable {\n getImodelAddon(imodel: IModelDb): any;\n\n setupRulesetDirectories(directories: string[]): NativePlatformResponse<void>;\n setupSupplementalRulesetDirectories(directories: string[]): NativePlatformResponse<void>;\n\n forceLoadSchemas(db: any): Promise<NativePlatformResponse<void>>;\n\n registerSupplementalRuleset(serializedRulesetJson: string): NativePlatformResponse<string>;\n getRulesets(rulesetId: string): NativePlatformResponse<string>;\n addRuleset(serializedRulesetJson: string): NativePlatformResponse<string>;\n removeRuleset(rulesetId: string, hash: string): NativePlatformResponse<boolean>;\n clearRulesets(): NativePlatformResponse<void>;\n\n handleRequest(db: any, options: string, cancelEvent?: BeEvent<() => void>): Promise<NativePlatformResponse<string>>;\n\n getRulesetVariableValue(rulesetId: string, variableId: string, type: VariableValueTypes): NativePlatformResponse<VariableValue>;\n setRulesetVariableValue(rulesetId: string, variableId: string, type: VariableValueTypes, value: VariableValue): NativePlatformResponse<void>;\n unsetRulesetVariableValue(rulesetId: string, variableId: string): NativePlatformResponse<void>;\n\n getUpdateInfo(): NativePlatformResponse<UpdateInfo | undefined>;\n}\n\n/** @internal */\nexport interface DefaultNativePlatformProps {\n id: string;\n taskAllocationsMap: { [priority: number]: number };\n isChangeTrackingEnabled: boolean;\n cacheConfig?: IModelJsNative.ECPresentationHierarchyCacheConfig;\n contentCacheSize?: number;\n workerConnectionCacheSize?: number;\n defaultFormats?: NativePresentationDefaultUnitFormats;\n useMmap?: boolean | number;\n}\n\n/** @internal */\nexport class PresentationNativePlatformResponseError extends PresentationError {\n public readonly diagnostics?: DiagnosticsScopeLogs;\n public constructor(errorResponse: IModelJsNative.ECPresentationManagerResponse<unknown>) {\n assert(!!errorResponse.error);\n super(getPresentationStatusFromNativeResponseStatus(errorResponse.error.status), errorResponse.error.message);\n this.diagnostics = errorResponse.diagnostics;\n }\n}\n\nfunction getPresentationStatusFromNativeResponseStatus(nativeResponseStatus: IModelJsNative.ECPresentationStatus): PresentationStatus {\n switch (nativeResponseStatus) {\n case IModelJsNative.ECPresentationStatus.InvalidArgument: return PresentationStatus.InvalidArgument;\n case IModelJsNative.ECPresentationStatus.ResultSetTooLarge: return PresentationStatus.ResultSetTooLarge;\n case IModelJsNative.ECPresentationStatus.Canceled: return PresentationStatus.Canceled;\n }\n return PresentationStatus.Error;\n}\n\n/** @internal */\nexport const createDefaultNativePlatform = (props: DefaultNativePlatformProps): new () => NativePlatformDefinition => {\n // note the implementation is constructed here to make PresentationManager\n // usable without loading the actual addon (if addon is set to something other)\n return class implements NativePlatformDefinition {\n private _nativeAddon: IModelJsNative.ECPresentationManager;\n public constructor() {\n const cacheConfig = props.cacheConfig ?? { mode: HierarchyCacheMode.Disk, directory: \"\" };\n const defaultFormats = props.defaultFormats ? this.getSerializedDefaultFormatsMap(props.defaultFormats) : {};\n this._nativeAddon = new IModelHost.platform.ECPresentationManager({ ...props, cacheConfig, defaultFormats });\n }\n private getSerializedDefaultFormatsMap(defaultMap: NativePresentationDefaultUnitFormats) {\n const res: {\n [phenomenon: string]: Array<{\n unitSystems: string[];\n serializedFormat: string;\n }>;\n } = {};\n Object.entries(defaultMap).forEach(([phenomenon, formats]) => {\n res[phenomenon] = formats.map((value) => ({ unitSystems: value.unitSystems, serializedFormat: JSON.stringify(value.format) }));\n });\n return res;\n }\n private createSuccessResponse<T>(response: IModelJsNative.ECPresentationManagerResponse<T>): NativePlatformResponse<T> {\n const retValue: NativePlatformResponse<T> = { result: response.result! };\n if (response.diagnostics)\n retValue.diagnostics = response.diagnostics;\n return retValue;\n }\n private handleResult<T>(response: IModelJsNative.ECPresentationManagerResponse<T>): NativePlatformResponse<T> {\n if (response.error)\n throw new PresentationNativePlatformResponseError(response);\n return this.createSuccessResponse(response);\n }\n private handleConvertedResult<TSource, TTarget>(response: IModelJsNative.ECPresentationManagerResponse<TSource>, conv: (s: TSource) => TTarget): NativePlatformResponse<TTarget> {\n return this.handleResult<TTarget>((response.result ? { ...response, result: conv(response.result) } : response) as IModelJsNative.ECPresentationManagerResponse<TTarget>);\n }\n private handleVoidResult(response: IModelJsNative.ECPresentationManagerResponse<void>): NativePlatformResponse<void> {\n if (response.error)\n throw new PresentationNativePlatformResponseError(response);\n return this.createSuccessResponse(response);\n }\n public dispose() {\n this._nativeAddon.dispose();\n }\n public async forceLoadSchemas(db: any): Promise<NativePlatformResponse<void>> {\n const response = await this._nativeAddon.forceLoadSchemas(db);\n if (response.error)\n throw new PresentationError(PresentationStatus.Error, response.error.message);\n return this.createSuccessResponse(response);\n }\n public setupRulesetDirectories(directories: string[]) {\n return this.handleVoidResult(this._nativeAddon.setupRulesetDirectories(directories));\n }\n public setupSupplementalRulesetDirectories(directories: string[]) {\n return this.handleVoidResult(this._nativeAddon.setupSupplementalRulesetDirectories(directories));\n }\n public getImodelAddon(imodel: IModelDb): any {\n if (!imodel.isOpen)\n throw new PresentationError(PresentationStatus.InvalidArgument, \"imodel\");\n return imodel.nativeDb;\n }\n public registerSupplementalRuleset(serializedRulesetJson: string) {\n return this.handleResult<string>(this._nativeAddon.registerSupplementalRuleset(serializedRulesetJson));\n }\n public getRulesets(rulesetId: string) {\n return this.handleResult<string>(this._nativeAddon.getRulesets(rulesetId));\n }\n public addRuleset(serializedRulesetJson: string) {\n return this.handleResult<string>(this._nativeAddon.addRuleset(serializedRulesetJson));\n }\n public removeRuleset(rulesetId: string, hash: string) {\n return this.handleResult<boolean>(this._nativeAddon.removeRuleset(rulesetId, hash));\n }\n public clearRulesets() {\n return this.handleVoidResult(this._nativeAddon.clearRulesets());\n }\n public async handleRequest(db: any, options: string, cancelEvent?: BeEvent<() => void>) {\n const response = this._nativeAddon.handleRequest(db, options);\n cancelEvent?.addOnce(() => response.cancel());\n const result = await response.result;\n return this.handleConvertedResult<Buffer, string>(result, (buffer) => buffer.toString());\n }\n public getRulesetVariableValue(rulesetId: string, variableId: string, type: VariableValueTypes) {\n return this.handleResult<VariableValue>(this._nativeAddon.getRulesetVariableValue(rulesetId, variableId, type));\n }\n public setRulesetVariableValue(rulesetId: string, variableId: string, type: VariableValueTypes, value: VariableValueJSON) {\n return this.handleVoidResult(this._nativeAddon.setRulesetVariableValue(rulesetId, variableId, type, value));\n }\n public unsetRulesetVariableValue(rulesetId: string, variableId: string) {\n return this.handleVoidResult(this._nativeAddon.unsetRulesetVariableValue(rulesetId, variableId));\n }\n public getUpdateInfo() {\n return this.handleResult<UpdateInfo | undefined>(this._nativeAddon.getUpdateInfo());\n }\n };\n};\n"]}
|
|
@@ -5,7 +5,7 @@ import { IModelDb } from "@itwin/core-backend";
|
|
|
5
5
|
import { Id64String } from "@itwin/core-bentley";
|
|
6
6
|
import { UnitSystemKey } from "@itwin/core-quantity";
|
|
7
7
|
import { SchemaContext } from "@itwin/ecschema-metadata";
|
|
8
|
-
import { UnitSystemFormat as CommonUnitSystemFormat, ComputeSelectionRequestOptions, Content, ContentDescriptorRequestOptions, ContentRequestOptions, ContentSourcesRequestOptions, Descriptor, DescriptorOverrides, DisplayLabelRequestOptions, DisplayLabelsRequestOptions, DisplayValueGroup, DistinctValuesRequestOptions, ElementProperties, FilterByInstancePathsHierarchyRequestOptions, FilterByTextHierarchyRequestOptions, FormatsMap, HierarchyCompareInfo, HierarchyCompareOptions, HierarchyLevelDescriptorRequestOptions, HierarchyRequestOptions, InstanceKey, KeySet, LabelDefinition, MultiElementPropertiesRequestOptions, Node, NodeKey, NodePathElement, Paged, PagedResponse, Prioritized, Ruleset, RulesetVariable, SelectClassInfo, SelectionScope, SelectionScopeRequestOptions, SingleElementPropertiesRequestOptions, WithCancelEvent } from "@itwin/presentation-common";
|
|
8
|
+
import { UnitSystemFormat as CommonUnitSystemFormat, ComputeSelectionRequestOptions, Content, ContentDescriptorRequestOptions, ContentRequestOptions, ContentSourcesRequestOptions, Descriptor, DescriptorOverrides, DisplayLabelRequestOptions, DisplayLabelsRequestOptions, DisplayValueGroup, DistinctValuesRequestOptions, ElementProperties, FilterByInstancePathsHierarchyRequestOptions, FilterByTextHierarchyRequestOptions, FormatsMap, HierarchyCompareInfo, HierarchyCompareOptions, HierarchyLevelDescriptorRequestOptions, HierarchyRequestOptions, InstanceKey, Item, KeySet, LabelDefinition, MultiElementPropertiesRequestOptions, Node, NodeKey, NodePathElement, Paged, PagedResponse, Prioritized, Ruleset, RulesetVariable, SelectClassInfo, SelectionScope, SelectionScopeRequestOptions, SingleElementPropertiesRequestOptions, WithCancelEvent } from "@itwin/presentation-common";
|
|
9
9
|
import { NativePlatformDefinition } from "./NativePlatform";
|
|
10
10
|
import { PresentationManagerDetail } from "./PresentationManagerDetail";
|
|
11
11
|
import { RulesetManager } from "./RulesetManager";
|
|
@@ -158,9 +158,9 @@ export type UnitSystemFormat = CommonUnitSystemFormat;
|
|
|
158
158
|
* Data structure for multiple element properties request response.
|
|
159
159
|
* @public
|
|
160
160
|
*/
|
|
161
|
-
export interface MultiElementPropertiesResponse {
|
|
161
|
+
export interface MultiElementPropertiesResponse<TParsedContent = ElementProperties> {
|
|
162
162
|
total: number;
|
|
163
|
-
iterator: () => AsyncGenerator<
|
|
163
|
+
iterator: () => AsyncGenerator<TParsedContent[]>;
|
|
164
164
|
}
|
|
165
165
|
/**
|
|
166
166
|
* Configuration options for supplying asset paths to [[PresentationManager]].
|
|
@@ -400,6 +400,11 @@ export declare class PresentationManager {
|
|
|
400
400
|
* @public
|
|
401
401
|
*/
|
|
402
402
|
getContentSetSize(requestOptions: WithCancelEvent<Prioritized<ContentRequestOptions<IModelDb, Descriptor | DescriptorOverrides, KeySet, RulesetVariable>>> & BackendDiagnosticsAttribute): Promise<number>;
|
|
403
|
+
/**
|
|
404
|
+
* Retrieves the content set based on the supplied content descriptor.
|
|
405
|
+
* @beta
|
|
406
|
+
*/
|
|
407
|
+
getContentSet(requestOptions: WithCancelEvent<Prioritized<Paged<ContentRequestOptions<IModelDb, Descriptor, KeySet, RulesetVariable>>>> & BackendDiagnosticsAttribute): Promise<Item[]>;
|
|
403
408
|
/**
|
|
404
409
|
* Retrieves the content based on the supplied content descriptor override.
|
|
405
410
|
* @public
|
|
@@ -422,7 +427,7 @@ export declare class PresentationManager {
|
|
|
422
427
|
* @return An object that contains element count and AsyncGenerator to iterate over properties of those elements in batches of undefined size.
|
|
423
428
|
* @public
|
|
424
429
|
*/
|
|
425
|
-
getElementProperties(requestOptions: WithCancelEvent<Prioritized<MultiElementPropertiesRequestOptions<IModelDb>>> & BackendDiagnosticsAttribute): Promise<MultiElementPropertiesResponse
|
|
430
|
+
getElementProperties<TParsedContent = ElementProperties>(requestOptions: WithCancelEvent<Prioritized<MultiElementPropertiesRequestOptions<IModelDb, TParsedContent>>> & BackendDiagnosticsAttribute): Promise<MultiElementPropertiesResponse<TParsedContent>>;
|
|
426
431
|
private getMultipleElementProperties;
|
|
427
432
|
/**
|
|
428
433
|
* Retrieves display label definition of specific item
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PresentationManager.d.ts","sourceRoot":"","sources":["../../../src/presentation-backend/PresentationManager.ts"],"names":[],"mappings":"AAIA;;GAEG;
|
|
1
|
+
{"version":3,"file":"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