@itwin/presentation-testing 4.0.0-dev.9 → 4.0.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 +301 -2
- package/LICENSE.md +1 -1
- package/README.md +1 -1
- package/lib/cjs/presentation-testing/ContentBuilder.d.ts +3 -3
- package/lib/cjs/presentation-testing/ContentBuilder.d.ts.map +1 -1
- package/lib/cjs/presentation-testing/ContentBuilder.js +27 -27
- package/lib/cjs/presentation-testing/ContentBuilder.js.map +1 -1
- package/lib/cjs/presentation-testing/Helpers.d.ts +1 -1
- package/lib/cjs/presentation-testing/Helpers.d.ts.map +1 -1
- package/lib/cjs/presentation-testing/Helpers.js +31 -17
- package/lib/cjs/presentation-testing/Helpers.js.map +1 -1
- package/lib/cjs/presentation-testing/HierarchyBuilder.d.ts +2 -2
- package/lib/cjs/presentation-testing/HierarchyBuilder.d.ts.map +1 -1
- package/lib/cjs/presentation-testing/HierarchyBuilder.js +8 -6
- package/lib/cjs/presentation-testing/HierarchyBuilder.js.map +1 -1
- package/lib/cjs/presentation-testing/IModelUtilities.d.ts +19 -5
- package/lib/cjs/presentation-testing/IModelUtilities.d.ts.map +1 -1
- package/lib/cjs/presentation-testing/IModelUtilities.js +16 -13
- package/lib/cjs/presentation-testing/IModelUtilities.js.map +1 -1
- package/lib/cjs/presentation-testing.js +8 -4
- package/lib/cjs/presentation-testing.js.map +1 -1
- package/lib/esm/presentation-testing/ContentBuilder.d.ts +3 -3
- package/lib/esm/presentation-testing/ContentBuilder.d.ts.map +1 -1
- package/lib/esm/presentation-testing/ContentBuilder.js +27 -27
- package/lib/esm/presentation-testing/ContentBuilder.js.map +1 -1
- package/lib/esm/presentation-testing/Helpers.d.ts +1 -1
- package/lib/esm/presentation-testing/Helpers.d.ts.map +1 -1
- package/lib/esm/presentation-testing/Helpers.js +27 -17
- package/lib/esm/presentation-testing/Helpers.js.map +1 -1
- package/lib/esm/presentation-testing/HierarchyBuilder.d.ts +2 -2
- package/lib/esm/presentation-testing/HierarchyBuilder.d.ts.map +1 -1
- package/lib/esm/presentation-testing/HierarchyBuilder.js +8 -6
- package/lib/esm/presentation-testing/HierarchyBuilder.js.map +1 -1
- package/lib/esm/presentation-testing/IModelUtilities.d.ts +19 -5
- package/lib/esm/presentation-testing/IModelUtilities.d.ts.map +1 -1
- package/lib/esm/presentation-testing/IModelUtilities.js +15 -13
- package/lib/esm/presentation-testing/IModelUtilities.js.map +1 -1
- package/lib/esm/presentation-testing.js +3 -3
- package/lib/esm/presentation-testing.js.map +1 -1
- package/package.json +36 -32
package/LICENSE.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# MIT License
|
|
2
2
|
|
|
3
|
-
Copyright © 2017-
|
|
3
|
+
Copyright © 2017-2023 Bentley Systems, Incorporated. All rights reserved.
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
6
|
|
package/README.md
CHANGED
|
@@ -4,4 +4,4 @@ Copyright © Bentley Systems, Incorporated. All rights reserved. See LICENSE.md
|
|
|
4
4
|
|
|
5
5
|
## Description
|
|
6
6
|
|
|
7
|
-
The
|
|
7
|
+
The **@itwin/presentation-testing** package contains helper classes and APIs that help test presentation modules.
|
|
@@ -63,7 +63,7 @@ export declare class ContentBuilder {
|
|
|
63
63
|
private doCreateContent;
|
|
64
64
|
/**
|
|
65
65
|
* Create a list of property records using the supplied presentation ruleset.
|
|
66
|
-
* @param rulesetOrId Either a [
|
|
66
|
+
* @param rulesetOrId Either a [Ruleset]($presentation-common) object or a ruleset id.
|
|
67
67
|
* @param instanceKeys Keys of instances that should be queried.
|
|
68
68
|
* @param displayType Type of content container display. For example:
|
|
69
69
|
* "PropertyPane", "Grid", "List" etc.
|
|
@@ -74,7 +74,7 @@ export declare class ContentBuilder {
|
|
|
74
74
|
/**
|
|
75
75
|
* Create a list of grouped property records using the supplied presentation ruleset.
|
|
76
76
|
* Each group includes all of the class instances.
|
|
77
|
-
* @param rulesetOrId Either a [
|
|
77
|
+
* @param rulesetOrId Either a [Ruleset]($presentation-common) object or a ruleset id.
|
|
78
78
|
* @param displayType Type of content container display. For example:
|
|
79
79
|
* "PropertyPane", "Grid", "List" etc.
|
|
80
80
|
* @deprecated in 3.x. This method turned out to be useless as it creates content for too many instances. Should use [[createContent]] instead.
|
|
@@ -83,7 +83,7 @@ export declare class ContentBuilder {
|
|
|
83
83
|
/**
|
|
84
84
|
* Create a list of grouped property records using the supplied presentation ruleset.
|
|
85
85
|
* Each group includes at most one class instance.
|
|
86
|
-
* @param rulesetOrId Either a [
|
|
86
|
+
* @param rulesetOrId Either a [Ruleset]($presentation-common) object or a ruleset id.
|
|
87
87
|
* @param displayType Type of content container display. For example:
|
|
88
88
|
* "PropertyPane", "Grid", "List" etc.
|
|
89
89
|
* @deprecated in 3.x. This method turned out to be useless as it creates content for too many instances. Should use [[createContent]] instead.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentBuilder.d.ts","sourceRoot":"","sources":["../../../src/presentation-testing/ContentBuilder.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAGvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EACL,OAAO,
|
|
1
|
+
{"version":3,"file":"ContentBuilder.d.ts","sourceRoot":"","sources":["../../../src/presentation-testing/ContentBuilder.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAGvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EACL,OAAO,EAGP,WAAW,EACX,MAAM,EACN,WAAW,EA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AE,MAAgD;CAG3I"}
|
|
@@ -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 Content
|
|
8
8
|
*/
|
|
@@ -50,51 +50,50 @@ class ContentBuilder {
|
|
|
50
50
|
const dataProvider = this._dataProvider ? this._dataProvider : new presentation_components_1.ContentDataProvider({ imodel: this._iModel, ruleset: rulesetId, displayType });
|
|
51
51
|
dataProvider.keys = new presentation_common_1.KeySet(instanceKeys);
|
|
52
52
|
const content = await dataProvider.getContent();
|
|
53
|
-
if (!content)
|
|
53
|
+
if (!content) {
|
|
54
54
|
return [];
|
|
55
|
+
}
|
|
55
56
|
const accumulator = new PropertyRecordsAccumulator(this._decimalPrecision);
|
|
56
57
|
(0, presentation_common_1.traverseContent)(accumulator, content);
|
|
57
58
|
return accumulator.records;
|
|
58
59
|
}
|
|
59
60
|
/**
|
|
60
61
|
* Create a list of property records using the supplied presentation ruleset.
|
|
61
|
-
* @param rulesetOrId Either a [
|
|
62
|
+
* @param rulesetOrId Either a [Ruleset]($presentation-common) object or a ruleset id.
|
|
62
63
|
* @param instanceKeys Keys of instances that should be queried.
|
|
63
64
|
* @param displayType Type of content container display. For example:
|
|
64
65
|
* "PropertyPane", "Grid", "List" etc.
|
|
65
66
|
*/
|
|
66
67
|
async createContent(rulesetOrId, instanceKeys, displayType = presentation_common_1.DefaultContentDisplayTypes.PropertyPane) {
|
|
67
|
-
if (typeof rulesetOrId === "string")
|
|
68
|
+
if (typeof rulesetOrId === "string") {
|
|
68
69
|
return this.doCreateContent(rulesetOrId, instanceKeys, displayType);
|
|
70
|
+
}
|
|
69
71
|
return (0, core_bentley_1.using)(await presentation_frontend_1.Presentation.presentation.rulesets().add(rulesetOrId), async (ruleset) => {
|
|
70
72
|
return this.doCreateContent(ruleset.id, instanceKeys, displayType);
|
|
71
73
|
});
|
|
72
74
|
}
|
|
73
75
|
async getECClassNames() {
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
rows.push(row);
|
|
82
|
-
}
|
|
83
|
-
return rows;
|
|
76
|
+
const reader = this._iModel.createQueryReader(`
|
|
77
|
+
SELECT s.Name schemaName, c.Name className FROM meta.ECClassDef c
|
|
78
|
+
INNER JOIN meta.ECSchemaDef s ON c.Schema.id = s.ECInstanceId
|
|
79
|
+
WHERE c.Modifier <> 1 AND c.Type = 0
|
|
80
|
+
ORDER BY s.Name, c.Name
|
|
81
|
+
`, undefined, { rowFormat: core_common_1.QueryRowFormat.UseJsPropertyNames });
|
|
82
|
+
return reader.toArray();
|
|
84
83
|
}
|
|
85
84
|
async createContentForClasses(rulesetOrId, limitInstances, displayType) {
|
|
86
85
|
const classNameEntries = await this.getECClassNames();
|
|
87
86
|
const contents = [];
|
|
88
87
|
for (const nameEntry of classNameEntries) {
|
|
89
88
|
// try {
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
if (!instanceIds.length)
|
|
89
|
+
const reader = this._iModel.createQueryReader(`
|
|
90
|
+
SELECT ECInstanceId FROM ONLY "${nameEntry.schemaName}"."${nameEntry.className}"
|
|
91
|
+
ORDER BY ECInstanceId
|
|
92
|
+
`, undefined, { rowFormat: core_common_1.QueryRowFormat.UseJsPropertyNames, limit: { count: limitInstances ? 1 : 4000 } });
|
|
93
|
+
const instanceIds = await reader.toArray();
|
|
94
|
+
if (!instanceIds.length) {
|
|
97
95
|
continue;
|
|
96
|
+
}
|
|
98
97
|
const instanceKeys = instanceIds.map((idEntry) => ({ className: `${nameEntry.schemaName}:${nameEntry.className}`, id: idEntry }));
|
|
99
98
|
contents.push({
|
|
100
99
|
className: `${nameEntry.schemaName}:${nameEntry.className}`,
|
|
@@ -106,7 +105,7 @@ class ContentBuilder {
|
|
|
106
105
|
/**
|
|
107
106
|
* Create a list of grouped property records using the supplied presentation ruleset.
|
|
108
107
|
* Each group includes all of the class instances.
|
|
109
|
-
* @param rulesetOrId Either a [
|
|
108
|
+
* @param rulesetOrId Either a [Ruleset]($presentation-common) object or a ruleset id.
|
|
110
109
|
* @param displayType Type of content container display. For example:
|
|
111
110
|
* "PropertyPane", "Grid", "List" etc.
|
|
112
111
|
* @deprecated in 3.x. This method turned out to be useless as it creates content for too many instances. Should use [[createContent]] instead.
|
|
@@ -117,7 +116,7 @@ class ContentBuilder {
|
|
|
117
116
|
/**
|
|
118
117
|
* Create a list of grouped property records using the supplied presentation ruleset.
|
|
119
118
|
* Each group includes at most one class instance.
|
|
120
|
-
* @param rulesetOrId Either a [
|
|
119
|
+
* @param rulesetOrId Either a [Ruleset]($presentation-common) object or a ruleset id.
|
|
121
120
|
* @param displayType Type of content container display. For example:
|
|
122
121
|
* "PropertyPane", "Grid", "List" etc.
|
|
123
122
|
* @deprecated in 3.x. This method turned out to be useless as it creates content for too many instances. Should use [[createContent]] instead.
|
|
@@ -155,10 +154,11 @@ class PropertyRecordsAccumulator extends presentation_components_1.PropertyRecor
|
|
|
155
154
|
};
|
|
156
155
|
}
|
|
157
156
|
processRawValue(value) {
|
|
158
|
-
if (this._decimalPrecision === undefined)
|
|
157
|
+
if (this._decimalPrecision === undefined) {
|
|
159
158
|
return value;
|
|
159
|
+
}
|
|
160
160
|
if (typeof value === "number") {
|
|
161
|
-
return +
|
|
161
|
+
return +Number(value).toFixed(this._decimalPrecision);
|
|
162
162
|
}
|
|
163
163
|
if (Array.isArray(value)) {
|
|
164
164
|
return value.map((item) => this.processRawValue(item));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentBuilder.js","sourceRoot":"","sources":["../../../src/presentation-testing/ContentBuilder.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,sDAA4C;AAC5C,oDAAoD;AAEpD,oEAGoC;AACpC,4EAAmH;AACnH,wEAA4D;AAiD5D;;;GAGG;AACH,MAAa,cAAc;IAKzB;;;;OAIG;IACH,YAAY,KAA0B;QATtC;;;;;WAA2C;QAC3C;;;;;WAA+D;QAC/D;;;;;WAAmC;QAQjC,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC;QAC5B,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,YAAY,CAAC;QACxC,IAAI,CAAC,iBAAiB,GAAG,KAAK,CAAC,gBAAgB,CAAC;IAClD,CAAC;IAEO,KAAK,CAAC,eAAe,CAAC,SAAiB,EAAE,YAA2B,EAAE,WAAmB;QAC/F,MAAM,YAAY,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,6CAAmB,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC,CAAC;QAClJ,YAAY,CAAC,IAAI,GAAG,IAAI,4BAAM,CAAC,YAAY,CAAC,CAAC;QAE7C,MAAM,OAAO,GAAG,MAAM,YAAY,CAAC,UAAU,EAAE,CAAC;QAChD,IAAI,CAAC,OAAO;YACV,OAAO,EAAE,CAAC;QAEZ,MAAM,WAAW,GAAG,IAAI,0BAA0B,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;QAC3E,IAAA,qCAAe,EAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QACtC,OAAO,WAAW,CAAC,OAAO,CAAC;IAC7B,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,aAA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["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Content\n */\n\nimport { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { using } from \"@itwin/core-bentley\";\nimport { QueryRowFormat } from \"@itwin/core-common\";\nimport { IModelConnection } from \"@itwin/core-frontend\";\nimport {\n Content, DefaultContentDisplayTypes, InstanceKey, KeySet, PageOptions, ProcessPrimitiveValueProps, RegisteredRuleset, Ruleset, traverseContent,\n Value, ValuesMap,\n} from \"@itwin/presentation-common\";\nimport { ContentDataProvider, FieldHierarchyRecord, PropertyRecordsBuilder } from \"@itwin/presentation-components\";\nimport { Presentation } from \"@itwin/presentation-frontend\";\n\n/**\n * Interface for a data provider, which is used by ContentBuilder.\n * @public\n */\nexport interface IContentBuilderDataProvider {\n /** Keys the data provider is creating content for */\n keys: Readonly<KeySet>;\n /** Get the size of content result set */\n getContentSetSize: () => Promise<number>;\n /** Get the content */\n getContent: (options?: PageOptions) => Promise<Readonly<Content> | undefined>;\n}\n\n/**\n * Property records grouped under a single className\n * @public\n */\nexport interface ContentBuilderResult {\n /** Full name of ECClass whose records are contained in this data structure */\n className: string;\n /** Property records for the ECClass instance */\n records: PropertyRecord[];\n}\n\n/**\n * Properties for creating a `ContentBuilder` instance.\n * @public\n */\nexport interface ContentBuilderProps {\n /** The iModel to pull data from */\n imodel: IModelConnection;\n\n /** Custom data provider that allows mocking data ContentBuilder receives */\n dataProvider?: IContentBuilderDataProvider;\n\n /**\n * Decimal precision or numeric types.\n *\n * Raw numeric values with high precision may slightly differ from platform to platform due to\n * rounding differences on different platforms. This may be a problem when used with snapshot testing,\n * in which case this attribute may be set to supply the maximum precision of raw numeric values.\n *\n * By default no rounding is applied.\n */\n decimalPrecision?: number;\n}\n\n/**\n * A class that constructs content from specified imodel and ruleset.\n * @public\n */\nexport class ContentBuilder {\n private readonly _iModel: IModelConnection;\n private _dataProvider: IContentBuilderDataProvider | undefined;\n private _decimalPrecision?: number;\n\n /**\n * Constructor\n * @param iModel\n * @param dataProvider\n */\n constructor(props: ContentBuilderProps) {\n this._iModel = props.imodel;\n this._dataProvider = props.dataProvider;\n this._decimalPrecision = props.decimalPrecision;\n }\n\n private async doCreateContent(rulesetId: string, instanceKeys: InstanceKey[], displayType: string): Promise<PropertyRecord[]> {\n const dataProvider = this._dataProvider ? this._dataProvider : new ContentDataProvider({ imodel: this._iModel, ruleset: rulesetId, displayType });\n dataProvider.keys = new KeySet(instanceKeys);\n\n const content = await dataProvider.getContent();\n if (!content)\n return [];\n\n const accumulator = new PropertyRecordsAccumulator(this._decimalPrecision);\n traverseContent(accumulator, content);\n return accumulator.records;\n }\n\n /**\n * Create a list of property records using the supplied presentation ruleset.\n * @param rulesetOrId Either a [[Ruleset]] object or a ruleset id.\n * @param instanceKeys Keys of instances that should be queried.\n * @param displayType Type of content container display. For example:\n * \"PropertyPane\", \"Grid\", \"List\" etc.\n */\n public async createContent(rulesetOrId: Ruleset | string, instanceKeys: InstanceKey[], displayType: string = DefaultContentDisplayTypes.PropertyPane) {\n if (typeof rulesetOrId === \"string\")\n return this.doCreateContent(rulesetOrId, instanceKeys, displayType);\n\n return using(await Presentation.presentation.rulesets().add(rulesetOrId), async (ruleset: RegisteredRuleset) => {\n return this.doCreateContent(ruleset.id, instanceKeys, displayType);\n });\n }\n\n private async getECClassNames(): Promise<Array<{ schemaName: string, className: string }>> {\n const rows = [];\n for await (const row of this._iModel.query(`\n SELECT s.Name schemaName, c.Name className FROM meta.ECClassDef c\n INNER JOIN meta.ECSchemaDef s ON c.Schema.id = s.ECInstanceId\n WHERE c.Modifier <> 1 AND c.Type = 0\n ORDER BY s.Name, c.Name\n `, undefined, { rowFormat: QueryRowFormat.UseJsPropertyNames })) {\n rows.push(row);\n }\n return rows;\n }\n\n private async createContentForClasses(rulesetOrId: Ruleset | string, limitInstances: boolean, displayType: string) {\n const classNameEntries = await this.getECClassNames();\n\n const contents: ContentBuilderResult[] = [];\n\n for (const nameEntry of classNameEntries) {\n // try {\n const instanceIds = [];\n for await (const row of this._iModel.query(`\n SELECT ECInstanceId FROM ONLY \"${nameEntry.schemaName}\".\"${nameEntry.className}\"\n ORDER BY ECInstanceId`, undefined, { rowFormat: QueryRowFormat.UseJsPropertyNames, limit: { count: limitInstances ? 1 : 4000 } })) {\n instanceIds.push(row.id);\n }\n\n if (!instanceIds.length)\n continue;\n\n const instanceKeys = instanceIds.map((idEntry) => ({ className: `${nameEntry.schemaName}:${nameEntry.className}`, id: idEntry } as InstanceKey));\n\n contents.push({\n className: `${nameEntry.schemaName}:${nameEntry.className}`,\n records: await this.createContent(rulesetOrId, instanceKeys, displayType),\n });\n }\n\n return contents;\n }\n\n /**\n * Create a list of grouped property records using the supplied presentation ruleset.\n * Each group includes all of the class instances.\n * @param rulesetOrId Either a [[Ruleset]] object or a ruleset id.\n * @param displayType Type of content container display. For example:\n * \"PropertyPane\", \"Grid\", \"List\" etc.\n * @deprecated in 3.x. This method turned out to be useless as it creates content for too many instances. Should use [[createContent]] instead.\n */\n public async createContentForAllInstances(rulesetOrId: Ruleset | string, displayType: string = DefaultContentDisplayTypes.PropertyPane) {\n return this.createContentForClasses(rulesetOrId, false, displayType);\n }\n\n /**\n * Create a list of grouped property records using the supplied presentation ruleset.\n * Each group includes at most one class instance.\n * @param rulesetOrId Either a [[Ruleset]] object or a ruleset id.\n * @param displayType Type of content container display. For example:\n * \"PropertyPane\", \"Grid\", \"List\" etc.\n * @deprecated in 3.x. This method turned out to be useless as it creates content for too many instances. Should use [[createContent]] instead.\n */\n public async createContentForInstancePerClass(rulesetOrId: Ruleset | string, displayType: string = DefaultContentDisplayTypes.PropertyPane) {\n return this.createContentForClasses(rulesetOrId, true, displayType);\n }\n}\n\nclass PropertyRecordsAccumulator extends PropertyRecordsBuilder {\n private _records: PropertyRecord[] = [];\n private _decimalPrecision?: number;\n\n public constructor(decimalPrecision?: number) {\n super();\n this._decimalPrecision = decimalPrecision;\n }\n\n public get records(): PropertyRecord[] {\n return this._records;\n }\n\n protected createRootPropertiesAppender() {\n return {\n append: (record: FieldHierarchyRecord) => {\n this._records.push(record.record);\n },\n };\n }\n\n private processRawValue(value: Value): Value {\n if (this._decimalPrecision === undefined)\n return value;\n\n if (typeof value === \"number\") {\n return +(Number(value)).toFixed(this._decimalPrecision);\n }\n\n if (Array.isArray(value)) {\n return value.map((item) => this.processRawValue(item));\n }\n\n if (value instanceof Object) {\n const res: ValuesMap = {};\n Object.entries(value).forEach(([key, memberValue]) => {\n res[key] = this.processRawValue(memberValue);\n });\n return res;\n }\n\n return value;\n }\n\n public override processPrimitiveValue(props: ProcessPrimitiveValueProps) {\n super.processPrimitiveValue({ ...props, rawValue: this.processRawValue(props.rawValue) });\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ContentBuilder.js","sourceRoot":"","sources":["../../../src/presentation-testing/ContentBuilder.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAGH,sDAA4C;AAC5C,oDAAoD;AAEpD,oEAaoC;AACpC,4EAAmH;AACnH,wEAA4D;AAiD5D;;;GAGG;AACH,MAAa,cAAc;IAKzB;;;;OAIG;IACH,YAAY,KAA0B;QATrB;;;;;WAA0B;QACnC;;;;;WAAuD;QACvD;;;;;WAA2B;QAQjC,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC;QAC5B,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,YAAY,CAAC;QACxC,IAAI,CAAC,iBAAiB,GAAG,KAAK,CAAC,gBAAgB,CAAC;IAClD,CAAC;IAEO,KAAK,CAAC,eAAe,CAAC,SAAiB,EAAE,YAA2B,EAAE,WAAmB;QAC/F,MAAM,YAAY,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,6CAAmB,CAAC,EAAE,MAAM,EAAE,IAA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G,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC;YAC/C,CAAC,CAAC,CAAC;YACH,OAAO,GAAG,CAAC;SACZ;QAED,OAAO,KAAK,CAAC;IACf,CAAC;IAEe,qBAAqB,CAAC,KAAiC;QACrE,KAAK,CAAC,qBAAqB,CAAC,EAAE,GAAG,KAAK,EAAE,QAAQ,EAAE,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC5F,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 Content\n */\n\nimport { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { using } from \"@itwin/core-bentley\";\nimport { QueryRowFormat } from \"@itwin/core-common\";\nimport { IModelConnection } from \"@itwin/core-frontend\";\nimport {\n Content,\n DefaultContentDisplayTypes,\n InstanceId,\n InstanceKey,\n KeySet,\n PageOptions,\n ProcessPrimitiveValueProps,\n RegisteredRuleset,\n Ruleset,\n traverseContent,\n Value,\n ValuesMap,\n} from \"@itwin/presentation-common\";\nimport { ContentDataProvider, FieldHierarchyRecord, PropertyRecordsBuilder } from \"@itwin/presentation-components\";\nimport { Presentation } from \"@itwin/presentation-frontend\";\n\n/**\n * Interface for a data provider, which is used by ContentBuilder.\n * @public\n */\nexport interface IContentBuilderDataProvider {\n /** Keys the data provider is creating content for */\n keys: Readonly<KeySet>;\n /** Get the size of content result set */\n getContentSetSize: () => Promise<number>;\n /** Get the content */\n getContent: (options?: PageOptions) => Promise<Readonly<Content> | undefined>;\n}\n\n/**\n * Property records grouped under a single className\n * @public\n */\nexport interface ContentBuilderResult {\n /** Full name of ECClass whose records are contained in this data structure */\n className: string;\n /** Property records for the ECClass instance */\n records: PropertyRecord[];\n}\n\n/**\n * Properties for creating a `ContentBuilder` instance.\n * @public\n */\nexport interface ContentBuilderProps {\n /** The iModel to pull data from */\n imodel: IModelConnection;\n\n /** Custom data provider that allows mocking data ContentBuilder receives */\n dataProvider?: IContentBuilderDataProvider;\n\n /**\n * Decimal precision or numeric types.\n *\n * Raw numeric values with high precision may slightly differ from platform to platform due to\n * rounding differences on different platforms. This may be a problem when used with snapshot testing,\n * in which case this attribute may be set to supply the maximum precision of raw numeric values.\n *\n * By default no rounding is applied.\n */\n decimalPrecision?: number;\n}\n\n/**\n * A class that constructs content from specified imodel and ruleset.\n * @public\n */\nexport class ContentBuilder {\n private readonly _iModel: IModelConnection;\n private _dataProvider: IContentBuilderDataProvider | undefined;\n private _decimalPrecision?: number;\n\n /**\n * Constructor\n * @param iModel\n * @param dataProvider\n */\n constructor(props: ContentBuilderProps) {\n this._iModel = props.imodel;\n this._dataProvider = props.dataProvider;\n this._decimalPrecision = props.decimalPrecision;\n }\n\n private async doCreateContent(rulesetId: string, instanceKeys: InstanceKey[], displayType: string): Promise<PropertyRecord[]> {\n const dataProvider = this._dataProvider ? this._dataProvider : new ContentDataProvider({ imodel: this._iModel, ruleset: rulesetId, displayType });\n dataProvider.keys = new KeySet(instanceKeys);\n\n const content = await dataProvider.getContent();\n if (!content) {\n return [];\n }\n\n const accumulator = new PropertyRecordsAccumulator(this._decimalPrecision);\n traverseContent(accumulator, content);\n return accumulator.records;\n }\n\n /**\n * Create a list of property records using the supplied presentation ruleset.\n * @param rulesetOrId Either a [Ruleset]($presentation-common) object or a ruleset id.\n * @param instanceKeys Keys of instances that should be queried.\n * @param displayType Type of content container display. For example:\n * \"PropertyPane\", \"Grid\", \"List\" etc.\n */\n public async createContent(rulesetOrId: Ruleset | string, instanceKeys: InstanceKey[], displayType: string = DefaultContentDisplayTypes.PropertyPane) {\n if (typeof rulesetOrId === \"string\") {\n return this.doCreateContent(rulesetOrId, instanceKeys, displayType);\n }\n\n return using(await Presentation.presentation.rulesets().add(rulesetOrId), async (ruleset: RegisteredRuleset) => {\n return this.doCreateContent(ruleset.id, instanceKeys, displayType);\n });\n }\n\n private async getECClassNames(): Promise<Array<{ schemaName: string; className: string }>> {\n const reader = this._iModel.createQueryReader(\n `\n SELECT s.Name schemaName, c.Name className FROM meta.ECClassDef c\n INNER JOIN meta.ECSchemaDef s ON c.Schema.id = s.ECInstanceId\n WHERE c.Modifier <> 1 AND c.Type = 0\n ORDER BY s.Name, c.Name\n `,\n undefined,\n { rowFormat: QueryRowFormat.UseJsPropertyNames },\n );\n return reader.toArray();\n }\n\n private async createContentForClasses(rulesetOrId: Ruleset | string, limitInstances: boolean, displayType: string) {\n const classNameEntries = await this.getECClassNames();\n\n const contents: ContentBuilderResult[] = [];\n\n for (const nameEntry of classNameEntries) {\n // try {\n const reader = this._iModel.createQueryReader(\n `\n SELECT ECInstanceId FROM ONLY \"${nameEntry.schemaName}\".\"${nameEntry.className}\"\n ORDER BY ECInstanceId\n `,\n undefined,\n { rowFormat: QueryRowFormat.UseJsPropertyNames, limit: { count: limitInstances ? 1 : 4000 } },\n );\n const instanceIds: InstanceId[] = await reader.toArray();\n\n if (!instanceIds.length) {\n continue;\n }\n\n const instanceKeys = instanceIds.map((idEntry) => ({ className: `${nameEntry.schemaName}:${nameEntry.className}`, id: idEntry } as InstanceKey));\n\n contents.push({\n className: `${nameEntry.schemaName}:${nameEntry.className}`,\n records: await this.createContent(rulesetOrId, instanceKeys, displayType),\n });\n }\n\n return contents;\n }\n\n /**\n * Create a list of grouped property records using the supplied presentation ruleset.\n * Each group includes all of the class instances.\n * @param rulesetOrId Either a [Ruleset]($presentation-common) object or a ruleset id.\n * @param displayType Type of content container display. For example:\n * \"PropertyPane\", \"Grid\", \"List\" etc.\n * @deprecated in 3.x. This method turned out to be useless as it creates content for too many instances. Should use [[createContent]] instead.\n */\n public async createContentForAllInstances(rulesetOrId: Ruleset | string, displayType: string = DefaultContentDisplayTypes.PropertyPane) {\n return this.createContentForClasses(rulesetOrId, false, displayType);\n }\n\n /**\n * Create a list of grouped property records using the supplied presentation ruleset.\n * Each group includes at most one class instance.\n * @param rulesetOrId Either a [Ruleset]($presentation-common) object or a ruleset id.\n * @param displayType Type of content container display. For example:\n * \"PropertyPane\", \"Grid\", \"List\" etc.\n * @deprecated in 3.x. This method turned out to be useless as it creates content for too many instances. Should use [[createContent]] instead.\n */\n public async createContentForInstancePerClass(rulesetOrId: Ruleset | string, displayType: string = DefaultContentDisplayTypes.PropertyPane) {\n return this.createContentForClasses(rulesetOrId, true, displayType);\n }\n}\n\nclass PropertyRecordsAccumulator extends PropertyRecordsBuilder {\n private _records: PropertyRecord[] = [];\n private _decimalPrecision?: number;\n\n public constructor(decimalPrecision?: number) {\n super();\n this._decimalPrecision = decimalPrecision;\n }\n\n public get records(): PropertyRecord[] {\n return this._records;\n }\n\n protected createRootPropertiesAppender() {\n return {\n append: (record: FieldHierarchyRecord) => {\n this._records.push(record.record);\n },\n };\n }\n\n private processRawValue(value: Value): Value {\n if (this._decimalPrecision === undefined) {\n return value;\n }\n\n if (typeof value === \"number\") {\n return +Number(value).toFixed(this._decimalPrecision);\n }\n\n if (Array.isArray(value)) {\n return value.map((item) => this.processRawValue(item));\n }\n\n if (value instanceof Object) {\n const res: ValuesMap = {};\n Object.entries(value).forEach(([key, memberValue]) => {\n res[key] = this.processRawValue(memberValue);\n });\n return res;\n }\n\n return value;\n }\n\n public override processPrimitiveValue(props: ProcessPrimitiveValueProps) {\n super.processPrimitiveValue({ ...props, rawValue: this.processRawValue(props.rawValue) });\n }\n}\n"]}
|
|
@@ -33,7 +33,7 @@ export interface PresentationTestingInitProps {
|
|
|
33
33
|
*
|
|
34
34
|
* @public
|
|
35
35
|
*/
|
|
36
|
-
export declare const initialize: (props?: PresentationTestingInitProps
|
|
36
|
+
export declare const initialize: (props?: PresentationTestingInitProps) => Promise<void>;
|
|
37
37
|
/**
|
|
38
38
|
* Undoes the setup made by `initialize`.
|
|
39
39
|
* @param frontendApp IModelApp implementation
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Helpers.d.ts","sourceRoot":"","sources":["../../../src/presentation-testing/Helpers.ts"],"names":[],"mappings":"AAIA;;GAEG;AAOH,OAAO,EAAc,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"Helpers.d.ts","sourceRoot":"","sources":["../../../src/presentation-testing/Helpers.ts"],"names":[],"mappings":"AAIA;;GAEG;AAOH,OAAO,EAAc,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGpE,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAe,MAAM,sBAAsB,CAAC;AAChF,OAAO,EACL,kBAAkB,EAElB,wBAAwB,IAAI,wBAAwB,EACpD,uBAAuB,EACxB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAwC,iBAAiB,IAAI,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AA0BpI,gBAAgB;AAChB,eAAO,MAAM,gBAAgB,QAAO,MAEnC,CAAC;AAGF,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,CAAC;AAEjF,cAAc;AACd,MAAM,WAAW,4BAA4B;IAC3C,4CAA4C;IAC5C,YAAY,CAAC,EAAE,wBAAwB,CAAC;IACxC,kCAAkC;IAClC,gBAAgB,CAAC,EAAE,iBAAiB,CAAC;IACrC,6CAA6C;IAC7C,aAAa,CAAC,EAAE,yBAAyB,CAAC;IAC1C,+BAA+B;IAC/B,WAAW,CAAC,EAAE;QAAE,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,gBAAgB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;KAAE,CAAC;IACtE,0BAA0B;IAC1B,kBAAkB,CAAC,EAAE,gBAAgB,CAAC;IACtC,wFAAwF;IACxF,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,WAAkB,4BAA4B,kBAoCpE,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,SAAS,mDA0BrB,CAAC"}
|
|
@@ -1,14 +1,18 @@
|
|
|
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 Helpers
|
|
8
8
|
*/
|
|
9
9
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
|
-
Object.
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
12
16
|
}) : (function(o, m, k, k2) {
|
|
13
17
|
if (k2 === undefined) k2 = k;
|
|
14
18
|
o[k2] = m[k];
|
|
@@ -52,11 +56,12 @@ function initializeRpcInterfaces(interfaces) {
|
|
|
52
56
|
});
|
|
53
57
|
}
|
|
54
58
|
};
|
|
55
|
-
for (const definition of interfaces)
|
|
56
|
-
core_common_1.RpcConfiguration.assign(definition, () => config);
|
|
57
|
-
|
|
59
|
+
for (const definition of interfaces) {
|
|
60
|
+
core_common_1.RpcConfiguration.assign(definition, () => config); // eslint-disable-line @itwin/no-internal
|
|
61
|
+
}
|
|
62
|
+
const instance = core_common_1.RpcConfiguration.obtain(config); // eslint-disable-line @itwin/no-internal
|
|
58
63
|
try {
|
|
59
|
-
core_common_1.RpcConfiguration.initializeInterfaces(instance);
|
|
64
|
+
core_common_1.RpcConfiguration.initializeInterfaces(instance); // eslint-disable-line @itwin/no-internal
|
|
60
65
|
}
|
|
61
66
|
catch {
|
|
62
67
|
// this may fail with "Error: RPC interface "xxx" is already initialized." because
|
|
@@ -80,22 +85,27 @@ exports.getTestOutputDir = getTestOutputDir;
|
|
|
80
85
|
* @public
|
|
81
86
|
*/
|
|
82
87
|
const initialize = async (props) => {
|
|
83
|
-
if (isInitialized)
|
|
88
|
+
if (isInitialized) {
|
|
84
89
|
return;
|
|
85
|
-
|
|
90
|
+
}
|
|
91
|
+
if (!props) {
|
|
86
92
|
props = {};
|
|
93
|
+
}
|
|
87
94
|
// set up rpc interfaces
|
|
88
95
|
initializeRpcInterfaces([core_common_1.SnapshotIModelRpcInterface, core_common_1.IModelReadRpcInterface, presentation_common_1.PresentationRpcInterface]);
|
|
89
96
|
// init backend
|
|
90
97
|
// make sure backend gets assigned an id which puts its resources into a unique directory
|
|
91
98
|
props.backendProps = props.backendProps ?? {};
|
|
92
|
-
|
|
93
|
-
|
|
99
|
+
// eslint-disable-next-line @itwin/no-internal
|
|
100
|
+
if (!props.backendProps.id) {
|
|
101
|
+
props.backendProps.id = `test-${core_bentley_1.Guid.createValue()}`; // eslint-disable-line @itwin/no-internal
|
|
102
|
+
}
|
|
94
103
|
await core_backend_1.IModelHost.startup({ cacheDir: (0, path_1.join)(__dirname, ".cache"), ...props.backendHostProps });
|
|
95
104
|
presentation_backend_1.Presentation.initialize(props.backendProps);
|
|
96
105
|
// init frontend
|
|
97
|
-
if (!props.frontendApp)
|
|
106
|
+
if (!props.frontendApp) {
|
|
98
107
|
props.frontendApp = core_frontend_1.NoRenderApp;
|
|
108
|
+
}
|
|
99
109
|
await props.frontendApp.startup(props.frontendAppOptions);
|
|
100
110
|
const defaultFrontendProps = {
|
|
101
111
|
presentation: {
|
|
@@ -116,20 +126,24 @@ exports.initialize = initialize;
|
|
|
116
126
|
* @public
|
|
117
127
|
*/
|
|
118
128
|
const terminate = async (frontendApp = core_frontend_1.IModelApp) => {
|
|
119
|
-
if (!isInitialized)
|
|
129
|
+
if (!isInitialized) {
|
|
120
130
|
return;
|
|
131
|
+
}
|
|
121
132
|
// store directory that needs to be cleaned-up
|
|
122
133
|
let hierarchiesCacheDirectory;
|
|
123
134
|
const hierarchiesCacheConfig = presentation_backend_1.Presentation.initProps?.caching?.hierarchies;
|
|
124
|
-
if (hierarchiesCacheConfig?.mode === presentation_backend_1.HierarchyCacheMode.Disk)
|
|
135
|
+
if (hierarchiesCacheConfig?.mode === presentation_backend_1.HierarchyCacheMode.Disk) {
|
|
125
136
|
hierarchiesCacheDirectory = hierarchiesCacheConfig?.directory;
|
|
126
|
-
|
|
137
|
+
}
|
|
138
|
+
else if (hierarchiesCacheConfig?.mode === presentation_backend_1.HierarchyCacheMode.Hybrid) {
|
|
127
139
|
hierarchiesCacheDirectory = hierarchiesCacheConfig?.disk?.directory;
|
|
140
|
+
}
|
|
128
141
|
// terminate backend
|
|
129
142
|
presentation_backend_1.Presentation.terminate();
|
|
130
143
|
await core_backend_1.IModelHost.shutdown();
|
|
131
|
-
if (hierarchiesCacheDirectory)
|
|
144
|
+
if (hierarchiesCacheDirectory) {
|
|
132
145
|
rimraf.sync(hierarchiesCacheDirectory);
|
|
146
|
+
}
|
|
133
147
|
// terminate frontend
|
|
134
148
|
presentation_frontend_1.Presentation.terminate();
|
|
135
149
|
await frontendApp.shutdown();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Helpers.js","sourceRoot":"","sources":["../../../src/presentation-testing/Helpers.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"Helpers.js","sourceRoot":"","sources":["../../../src/presentation-testing/Helpers.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,0BAA0B,CAAC,uGAAuG;AAElI,2BAA4B;AAC5B,+BAA4B;AAC5B,+CAAiC;AACjC,sDAAoE;AACpE,sD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E,OAAO,EAAE,WAAW,CAAC;IACnF,IAAI,sBAAsB,EAAE,IAAI,KAAK,yCAAkB,CAAC,IAAI,EAAE;QAC5D,yBAAyB,GAAG,sBAAsB,EAAE,SAAS,CAAC;KAC/D;SAAM,IAAI,sBAAsB,EAAE,IAAI,KAAK,yCAAkB,CAAC,MAAM,EAAE;QACrE,yBAAyB,GAAG,sBAAsB,EAAE,IAAI,EAAE,SAAS,CAAC;KACrE;IAED,oBAAoB;IACpB,mCAAmB,CAAC,SAAS,EAAE,CAAC;IAChC,MAAM,yBAAU,CAAC,QAAQ,EAAE,CAAC;IAC5B,IAAI,yBAAyB,EAAE;QAC7B,MAAM,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC;KACxC;IAED,qBAAqB;IACrB,oCAAoB,CAAC,SAAS,EAAE,CAAC;IACjC,MAAM,WAAW,CAAC,QAAQ,EAAE,CAAC;IAE7B,aAAa,GAAG,KAAK,CAAC;AACxB,CAAC,CAAC;AA1BW,QAAA,SAAS,aA0BpB","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 Helpers\n */\n\n/* istanbul ignore file */ // TODO: Remove istanbul ignore file when https://github.com/iTwin/itwinjs-backlog/issues/463 is fixed.\n\nimport { tmpdir } from \"os\";\nimport { join } from \"path\";\nimport * as rimraf from \"rimraf\";\nimport { IModelHost, IModelHostOptions } from \"@itwin/core-backend\";\nimport { Guid } from \"@itwin/core-bentley\";\nimport { IModelReadRpcInterface, RpcConfiguration, RpcDefaultConfiguration, RpcInterfaceDefinition, SnapshotIModelRpcInterface } from \"@itwin/core-common\";\nimport { IModelApp, IModelAppOptions, NoRenderApp } from \"@itwin/core-frontend\";\nimport {\n HierarchyCacheMode,\n Presentation as PresentationBackend,\n PresentationManagerProps as PresentationBackendProps,\n PresentationManagerMode,\n} from \"@itwin/presentation-backend\";\nimport { PresentationRpcInterface } from \"@itwin/presentation-common\";\nimport { Presentation as PresentationFrontend, PresentationProps as PresentationFrontendProps } from \"@itwin/presentation-frontend\";\n\nfunction initializeRpcInterfaces(interfaces: RpcInterfaceDefinition[]) {\n const config = class extends RpcDefaultConfiguration {\n public override interfaces: any = () => interfaces;\n };\n\n for (const definition of interfaces) {\n RpcConfiguration.assign(definition, () => config); // eslint-disable-line @itwin/no-internal\n }\n\n const instance = RpcConfiguration.obtain(config); // eslint-disable-line @itwin/no-internal\n\n try {\n RpcConfiguration.initializeInterfaces(instance); // eslint-disable-line @itwin/no-internal\n } catch {\n // this may fail with \"Error: RPC interface \"xxx\" is already initialized.\" because\n // multiple different tests want to set up rpc interfaces\n }\n}\n\nlet isInitialized = false;\n\nconst defaultTestOutputDir = tmpdir();\nlet testOutputDir: string | undefined;\n\n/** @internal */\nexport const getTestOutputDir = (): string => {\n return testOutputDir ?? defaultTestOutputDir;\n};\n\n// eslint-disable-next-line deprecation/deprecation\nexport { HierarchyCacheMode, PresentationManagerMode, PresentationBackendProps };\n\n/** @public */\nexport interface PresentationTestingInitProps {\n /** Properties for backend initialization */\n backendProps?: PresentationBackendProps;\n /** Properties for `IModelHost` */\n backendHostProps?: IModelHostOptions;\n /** Properties for frontend initialization */\n frontendProps?: PresentationFrontendProps;\n /** IModelApp implementation */\n frontendApp?: { startup: (opts?: IModelAppOptions) => Promise<void> };\n /** `IModelApp` options */\n frontendAppOptions?: IModelAppOptions;\n /** Custom test output directory. Defaults to temporary directory provided by the OS. */\n testOutputDir?: string;\n}\n\n/**\n * Initialize the framework for presentation testing. The function sets up backend,\n * frontend and RPC communication between them.\n *\n * @see `terminate`\n *\n * @public\n */\nexport const initialize = async (props?: PresentationTestingInitProps) => {\n if (isInitialized) {\n return;\n }\n\n if (!props) {\n props = {};\n }\n\n // set up rpc interfaces\n initializeRpcInterfaces([SnapshotIModelRpcInterface, IModelReadRpcInterface, PresentationRpcInterface]);\n\n // init backend\n // make sure backend gets assigned an id which puts its resources into a unique directory\n props.backendProps = props.backendProps ?? {};\n // eslint-disable-next-line @itwin/no-internal\n if (!props.backendProps.id) {\n props.backendProps.id = `test-${Guid.createValue()}`; // eslint-disable-line @itwin/no-internal\n }\n await IModelHost.startup({ cacheDir: join(__dirname, \".cache\"), ...props.backendHostProps });\n PresentationBackend.initialize(props.backendProps);\n\n // init frontend\n if (!props.frontendApp) {\n props.frontendApp = NoRenderApp;\n }\n await props.frontendApp.startup(props.frontendAppOptions);\n const defaultFrontendProps: PresentationFrontendProps = {\n presentation: {\n activeLocale: IModelApp.localization.getLanguageList()[0],\n },\n };\n await PresentationFrontend.initialize({ ...defaultFrontendProps, ...props.frontendProps });\n testOutputDir = props.testOutputDir;\n\n isInitialized = true;\n};\n\n/**\n * Undoes the setup made by `initialize`.\n * @param frontendApp IModelApp implementation\n *\n * @see `initialize`\n *\n * @public\n */\nexport const terminate = async (frontendApp = IModelApp) => {\n if (!isInitialized) {\n return;\n }\n\n // store directory that needs to be cleaned-up\n let hierarchiesCacheDirectory: string | undefined;\n const hierarchiesCacheConfig = PresentationBackend.initProps?.caching?.hierarchies;\n if (hierarchiesCacheConfig?.mode === HierarchyCacheMode.Disk) {\n hierarchiesCacheDirectory = hierarchiesCacheConfig?.directory;\n } else if (hierarchiesCacheConfig?.mode === HierarchyCacheMode.Hybrid) {\n hierarchiesCacheDirectory = hierarchiesCacheConfig?.disk?.directory;\n }\n\n // terminate backend\n PresentationBackend.terminate();\n await IModelHost.shutdown();\n if (hierarchiesCacheDirectory) {\n rimraf.sync(hierarchiesCacheDirectory);\n }\n\n // terminate frontend\n PresentationFrontend.terminate();\n await frontendApp.shutdown();\n\n isInitialized = false;\n};\n"]}
|
|
@@ -28,7 +28,7 @@ export interface HierarchyNode extends Omit<MappedNode, "children"> {
|
|
|
28
28
|
* A function that converts `TreeNodeItem` into a new custom object.
|
|
29
29
|
* @public
|
|
30
30
|
*/
|
|
31
|
-
export
|
|
31
|
+
export type NodeMappingFunc = (node: TreeNodeItem) => MappedNode;
|
|
32
32
|
/**
|
|
33
33
|
* Default [[NodeMappingFunc]] implementation that outputs the whole `TreeNodeItem` object.
|
|
34
34
|
* @public
|
|
@@ -63,7 +63,7 @@ export declare class HierarchyBuilder {
|
|
|
63
63
|
private doCreateHierarchy;
|
|
64
64
|
/**
|
|
65
65
|
* Create a hierarchy using the supplied presentation ruleset.
|
|
66
|
-
* @param rulesetOrId Either a [
|
|
66
|
+
* @param rulesetOrId Either a [Ruleset]($presentation-common) object or a ruleset id.
|
|
67
67
|
*/
|
|
68
68
|
createHierarchy(rulesetOrId: Ruleset | string): Promise<HierarchyNode[]>;
|
|
69
69
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HierarchyBuilder.d.ts","sourceRoot":"","sources":["../../../src/presentation-testing/HierarchyBuilder.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,IAAI,EAAqB,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAI9E;;;;;GAKG;AACH,MAAM,WAAW,UAAU;IACzB,wDAAwD;IACxD,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,CAAC;IACrB,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,KAAK,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC;IACjE,4BAA4B;IAC5B,QAAQ,CAAC,EAAE,aAAa,EAAE,CAAC;CAC5B;AAED;;;GAGG;AACH,
|
|
1
|
+
{"version":3,"file":"HierarchyBuilder.d.ts","sourceRoot":"","sources":["../../../src/presentation-testing/HierarchyBuilder.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,IAAI,EAAqB,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAI9E;;;;;GAKG;AACH,MAAM,WAAW,UAAU;IACzB,wDAAwD;IACxD,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,CAAC;IACrB,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,KAAK,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC;IACjE,4BAA4B;IAC5B,QAAQ,CAAC,EAAE,aAAa,EAAE,CAAC;CAC5B;AAED;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,IAAI,EAAE,YAAY,KAAK,UAAU,CAAC;AAEjE;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAE,eAMpC,CAAC;AAEF;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,mCAAmC;IACnC,MAAM,EAAE,gBAAgB,CAAC;IACzB;;;;OAIG;IACH,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC;AAED;;;;;GAKG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAmB;IAC3C,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAkB;IAEnD,kBAAkB;gBACN,KAAK,EAAE,qBAAqB;YAK1B,kBAAkB;YAalB,iBAAiB;IAM/B;;;OAGG;IACU,eAAe,CAAC,WAAW,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;CAStF"}
|
|
@@ -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 Hierarchies
|
|
8
8
|
*/
|
|
@@ -53,8 +53,9 @@ class HierarchyBuilder {
|
|
|
53
53
|
const { key: _key, ...nodeNoKey } = node;
|
|
54
54
|
const nodeIndex = hierarchy.push(this._nodeMappingFunc(nodeNoKey)) - 1;
|
|
55
55
|
const childNodes = await dataProvider.getNodes(node);
|
|
56
|
-
if (childNodes.length > 0)
|
|
56
|
+
if (childNodes.length > 0) {
|
|
57
57
|
hierarchy[nodeIndex].children = await this.createSubHierarchy(childNodes, dataProvider);
|
|
58
|
+
}
|
|
58
59
|
}
|
|
59
60
|
return hierarchy;
|
|
60
61
|
}
|
|
@@ -65,11 +66,12 @@ class HierarchyBuilder {
|
|
|
65
66
|
}
|
|
66
67
|
/**
|
|
67
68
|
* Create a hierarchy using the supplied presentation ruleset.
|
|
68
|
-
* @param rulesetOrId Either a [
|
|
69
|
+
* @param rulesetOrId Either a [Ruleset]($presentation-common) object or a ruleset id.
|
|
69
70
|
*/
|
|
70
71
|
async createHierarchy(rulesetOrId) {
|
|
71
|
-
if (typeof rulesetOrId === "string")
|
|
72
|
+
if (typeof rulesetOrId === "string") {
|
|
72
73
|
return this.doCreateHierarchy(rulesetOrId);
|
|
74
|
+
}
|
|
73
75
|
return (0, core_bentley_1.using)(await presentation_frontend_1.Presentation.presentation.rulesets().add(rulesetOrId), async (ruleset) => {
|
|
74
76
|
return this.doCreateHierarchy(ruleset.id);
|
|
75
77
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HierarchyBuilder.js","sourceRoot":"","sources":["../../../src/presentation-testing/HierarchyBuilder.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"HierarchyBuilder.js","sourceRoot":"","sources":["../../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,CAAC;IACnB,CAAC;IAEO,KAAK,CAAC,iBAAiB,CAAC,SAAiB;QAC/C,MAAM,YAAY,GAAG,IAAI,sDAA4B,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC;QACpG,MAAM,SAAS,GAAG,MAAM,YAAY,CAAC,QAAQ,EAAE,CAAC;QAChD,OAAO,IAAI,CAAC,kBAAkB,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;IAC1D,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,eAAe,CAAC,WAA6B;QACxD,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE;YACnC,OAAO,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;SAC5C;QAED,OAAO,IAAA,oBAAK,EAAC,MAAM,oCAAY,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,OAA0B,EAAE,EAAE;YAC7G,OAAO,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA1CD,4CA0CC","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 Hierarchies\n */\n\nimport { TreeNodeItem } from \"@itwin/components-react\";\nimport { using } from \"@itwin/core-bentley\";\nimport { IModelConnection } from \"@itwin/core-frontend\";\nimport { Omit, RegisteredRuleset, Ruleset } from \"@itwin/presentation-common\";\nimport { PresentationTreeDataProvider, PresentationTreeNodeItem } from \"@itwin/presentation-components\";\nimport { Presentation } from \"@itwin/presentation-frontend\";\n\n/**\n * Structure that describes a Node with any indexed properties\n * except `children`.\n *\n * @public\n */\nexport interface MappedNode {\n /** Indexer for all properties in this data structure */\n [index: string]: any;\n /** Prohibited property */\n children?: never;\n}\n\n/**\n * Node in a hierarchy.\n * @public\n */\nexport interface HierarchyNode extends Omit<MappedNode, \"children\"> {\n /** Children of this node */\n children?: HierarchyNode[];\n}\n\n/**\n * A function that converts `TreeNodeItem` into a new custom object.\n * @public\n */\nexport type NodeMappingFunc = (node: TreeNodeItem) => MappedNode;\n\n/**\n * Default [[NodeMappingFunc]] implementation that outputs the whole `TreeNodeItem` object.\n * @public\n */\nexport const defaultNodeMappingFunc: NodeMappingFunc = (node: TreeNodeItem) => {\n // Skip properties 'id', 'parentId' as they contain internal stuff\n // that callers are most likely not interested in. Otherwise they can supply\n // a custom `NodeMappingFunc` that does return those properties as well.\n const { id, parentId, ...resultNode } = node; // eslint-disable-line @typescript-eslint/no-unused-vars\n return resultNode;\n};\n\n/**\n * Properties for creating a `HierarchyBuilder` instance.\n * @public\n */\nexport interface HierarchyBuilderProps {\n /** The iModel to pull data from */\n imodel: IModelConnection;\n /**\n * A function that maps node to something that the user of\n * this API is interested in. E.g. custom implementation may skip some unimportant\n * node properties to make resulting object smaller and easier to read.\n */\n nodeMappingFunc?: NodeMappingFunc;\n}\n\n/**\n * A class that constructs simple node hierarchy from specified\n * imodel and ruleset.\n *\n * @public\n */\nexport class HierarchyBuilder {\n private readonly _iModel: IModelConnection;\n private readonly _nodeMappingFunc: NodeMappingFunc;\n\n /** Constructor */\n constructor(props: HierarchyBuilderProps) {\n this._iModel = props.imodel;\n this._nodeMappingFunc = props.nodeMappingFunc ?? defaultNodeMappingFunc;\n }\n\n private async createSubHierarchy(nodes: TreeNodeItem[], dataProvider: PresentationTreeDataProvider) {\n const hierarchy: HierarchyNode[] = [];\n for (const node of nodes) {\n const { key: _key, ...nodeNoKey } = node as PresentationTreeNodeItem;\n const nodeIndex = hierarchy.push(this._nodeMappingFunc(nodeNoKey)) - 1;\n const childNodes = await dataProvider.getNodes(node);\n if (childNodes.length > 0) {\n hierarchy[nodeIndex].children = await this.createSubHierarchy(childNodes, dataProvider);\n }\n }\n return hierarchy;\n }\n\n private async doCreateHierarchy(rulesetId: string): Promise<HierarchyNode[]> {\n const dataProvider = new PresentationTreeDataProvider({ imodel: this._iModel, ruleset: rulesetId });\n const rootNodes = await dataProvider.getNodes();\n return this.createSubHierarchy(rootNodes, dataProvider);\n }\n\n /**\n * Create a hierarchy using the supplied presentation ruleset.\n * @param rulesetOrId Either a [Ruleset]($presentation-common) object or a ruleset id.\n */\n public async createHierarchy(rulesetOrId: Ruleset | string): Promise<HierarchyNode[]> {\n if (typeof rulesetOrId === \"string\") {\n return this.doCreateHierarchy(rulesetOrId);\n }\n\n return using(await Presentation.presentation.rulesets().add(rulesetOrId), async (ruleset: RegisteredRuleset) => {\n return this.doCreateHierarchy(ruleset.id);\n });\n }\n}\n"]}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/** @packageDocumentation
|
|
2
2
|
* @module IModel
|
|
3
3
|
*/
|
|
4
|
+
/// <reference types="mocha" />
|
|
4
5
|
import { IModelDb } from "@itwin/core-backend";
|
|
5
6
|
import { Id64String } from "@itwin/core-bentley";
|
|
6
|
-
import { BisCodeSpec, Code, CodeScopeProps, ElementAspectProps, ElementProps, ModelProps } from "@itwin/core-common";
|
|
7
|
+
import { BisCodeSpec, Code, CodeScopeProps, ElementAspectProps, ElementProps, ModelProps, RelationshipProps } from "@itwin/core-common";
|
|
7
8
|
import { IModelConnection } from "@itwin/core-frontend";
|
|
8
9
|
/**
|
|
9
10
|
* Interface for IModel builder pattern. Used for building IModels to test rulesets.
|
|
10
|
-
*
|
|
11
11
|
* @beta
|
|
12
12
|
*/
|
|
13
13
|
export interface TestIModelBuilder {
|
|
@@ -16,7 +16,12 @@ export interface TestIModelBuilder {
|
|
|
16
16
|
/** Insert an element into the builder's iModel */
|
|
17
17
|
insertElement<TProps extends ElementProps>(props: TProps): Id64String;
|
|
18
18
|
/** Insert an element aspect into the specified element */
|
|
19
|
-
insertAspect<TProps extends ElementAspectProps>(props: TProps):
|
|
19
|
+
insertAspect<TProps extends ElementAspectProps>(props: TProps): Id64String;
|
|
20
|
+
/**
|
|
21
|
+
* Insert a relationship between two instances. The relationship is expected to be a subclass
|
|
22
|
+
* of `BisCore:ElementRefersToElements` or `BisCore:ElementDrivesElement`.
|
|
23
|
+
*/
|
|
24
|
+
insertRelationship<TProps extends RelationshipProps>(props: TProps): Id64String;
|
|
20
25
|
/**
|
|
21
26
|
* Create code for specified element.
|
|
22
27
|
* Code value has to be unique within its scope (see [Codes documentation page]($docs/bis/guide/fundamentals/codes.md)).
|
|
@@ -27,10 +32,16 @@ export interface TestIModelBuilder {
|
|
|
27
32
|
* Function that creates an iModel and returns a connection to it.
|
|
28
33
|
* @param name Name of test IModel
|
|
29
34
|
* @param cb Callback function that receives an [[TestIModelBuilder]] to fill the iModel with data
|
|
30
|
-
*
|
|
31
35
|
* @beta
|
|
32
36
|
*/
|
|
33
37
|
export declare function buildTestIModel(name: string, cb: (builder: TestIModelBuilder) => void): Promise<IModelConnection>;
|
|
38
|
+
/**
|
|
39
|
+
* Function that creates an iModel and returns a connection to it.
|
|
40
|
+
* @param mochaContext Mocha context to generate iModel name from
|
|
41
|
+
* @param cb Callback function that receives an [[TestIModelBuilder]] to fill the iModel with data
|
|
42
|
+
* @beta
|
|
43
|
+
*/
|
|
44
|
+
export declare function buildTestIModel(mochaContext: Mocha.Context, cb: (builder: TestIModelBuilder) => void): Promise<IModelConnection>;
|
|
34
45
|
/**
|
|
35
46
|
* Default implementation of IModel builder pattern. Used for building IModels to test rulesets.
|
|
36
47
|
*
|
|
@@ -41,7 +52,10 @@ export declare class IModelBuilder implements TestIModelBuilder {
|
|
|
41
52
|
constructor(iModel: IModelDb);
|
|
42
53
|
insertModel<TProps extends ModelProps>(props: TProps): Id64String;
|
|
43
54
|
insertElement<TProps extends ElementProps>(props: TProps): Id64String;
|
|
44
|
-
insertAspect<TProps extends ElementAspectProps>(props: TProps):
|
|
55
|
+
insertAspect<TProps extends ElementAspectProps>(props: TProps): Id64String;
|
|
56
|
+
insertRelationship<TProps extends RelationshipProps>(props: TProps): Id64String;
|
|
45
57
|
createCode(scopeModelId: CodeScopeProps, codeSpecName: BisCodeSpec, codeValue: string): Code;
|
|
46
58
|
}
|
|
59
|
+
/** @internal */
|
|
60
|
+
export declare function createFileNameFromString(str: string): string;
|
|
47
61
|
//# sourceMappingURL=IModelUtilities.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IModelUtilities.d.ts","sourceRoot":"","sources":["../../../src/presentation-testing/IModelUtilities.ts"],"names":[],"mappings":"AAIA;;GAEG
|
|
1
|
+
{"version":3,"file":"IModelUtilities.d.ts","sourceRoot":"","sources":["../../../src/presentation-testing/IModelUtilities.ts"],"names":[],"mappings":"AAIA;;GAEG;;AAIH,OAAO,EAAE,QAAQ,EAA0B,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EACL,WAAW,EACX,IAAI,EACJ,cAAc,EAEd,kBAAkB,EAClB,YAAY,EAEZ,UAAU,EACV,iBAAiB,EAClB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,gBAAgB,EAAsB,MAAM,sBAAsB,CAAC;AAG5E;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,+CAA+C;IAC/C,WAAW,CAAC,MAAM,SAAS,UAAU,EAAE,KAAK,EAAE,MAAM,GAAG,UAAU,CAAC;IAClE,kDAAkD;IAClD,aAAa,CAAC,MAAM,SAAS,YAAY,EAAE,KAAK,EAAE,MAAM,GAAG,UAAU,CAAC;IACtE,0DAA0D;IAC1D,YAAY,CAAC,MAAM,SAAS,kBAAkB,EAAE,KAAK,EAAE,MAAM,GAAG,UAAU,CAAC;IAC3E;;;OAGG;IACH,kBAAkB,CAAC,MAAM,SAAS,iBAAiB,EAAE,KAAK,EAAE,MAAM,GAAG,UAAU,CAAC;IAChF;;;OAGG;IACH,UAAU,CAAC,YAAY,EAAE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