@itwin/presentation-common 5.2.0-dev.8 → 5.3.0-dev.2
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 +38 -1
- package/Ruleset.schema.json +18 -0
- package/lib/cjs/presentation-common/KeySet.d.ts +22 -7
- package/lib/cjs/presentation-common/KeySet.d.ts.map +1 -1
- package/lib/cjs/presentation-common/KeySet.js +28 -37
- package/lib/cjs/presentation-common/KeySet.js.map +1 -1
- package/lib/cjs/presentation-common/KoqPropertyValueFormatter.d.ts +2 -0
- package/lib/cjs/presentation-common/KoqPropertyValueFormatter.d.ts.map +1 -1
- package/lib/cjs/presentation-common/KoqPropertyValueFormatter.js +2 -2
- package/lib/cjs/presentation-common/KoqPropertyValueFormatter.js.map +1 -1
- package/lib/cjs/presentation-common/LocalizationHelper.d.ts +1 -1
- package/lib/cjs/presentation-common/LocalizationHelper.d.ts.map +1 -1
- package/lib/cjs/presentation-common/LocalizationHelper.js +9 -7
- package/lib/cjs/presentation-common/LocalizationHelper.js.map +1 -1
- package/lib/cjs/presentation-common/PresentationManagerOptions.d.ts +10 -0
- package/lib/cjs/presentation-common/PresentationManagerOptions.d.ts.map +1 -1
- package/lib/cjs/presentation-common/PresentationManagerOptions.js.map +1 -1
- package/lib/cjs/presentation-common/PresentationRpcInterface.d.ts +8 -0
- package/lib/cjs/presentation-common/PresentationRpcInterface.d.ts.map +1 -1
- package/lib/cjs/presentation-common/PresentationRpcInterface.js +1 -2
- package/lib/cjs/presentation-common/PresentationRpcInterface.js.map +1 -1
- package/lib/cjs/presentation-common/RpcRequestsHandler.d.ts.map +1 -1
- package/lib/cjs/presentation-common/RpcRequestsHandler.js +2 -16
- package/lib/cjs/presentation-common/RpcRequestsHandler.js.map +1 -1
- package/lib/cjs/presentation-common/Update.d.ts +16 -0
- package/lib/cjs/presentation-common/Update.d.ts.map +1 -1
- package/lib/cjs/presentation-common/Update.js +1 -0
- package/lib/cjs/presentation-common/Update.js.map +1 -1
- package/lib/cjs/presentation-common/Utils.d.ts.map +1 -1
- package/lib/cjs/presentation-common/Utils.js +2 -0
- package/lib/cjs/presentation-common/Utils.js.map +1 -1
- package/lib/cjs/presentation-common/content/ContentTraverser.d.ts.map +1 -1
- package/lib/cjs/presentation-common/content/ContentTraverser.js +14 -10
- package/lib/cjs/presentation-common/content/ContentTraverser.js.map +1 -1
- package/lib/cjs/presentation-common/content/PropertyValueFormatter.d.ts.map +1 -1
- package/lib/cjs/presentation-common/content/PropertyValueFormatter.js +6 -1
- package/lib/cjs/presentation-common/content/PropertyValueFormatter.js.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.d.ts +2 -0
- package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.d.ts.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.js +1 -0
- package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.js.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/Key.d.ts +23 -1
- package/lib/cjs/presentation-common/hierarchy/Key.d.ts.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/Key.js +8 -1
- package/lib/cjs/presentation-common/hierarchy/Key.js.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/Node.d.ts +4 -0
- package/lib/cjs/presentation-common/hierarchy/Node.d.ts.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/Node.js +1 -0
- package/lib/cjs/presentation-common/hierarchy/Node.js.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/NodePathElement.d.ts +4 -0
- package/lib/cjs/presentation-common/hierarchy/NodePathElement.d.ts.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/NodePathElement.js +1 -0
- package/lib/cjs/presentation-common/hierarchy/NodePathElement.js.map +1 -1
- package/lib/cjs/presentation-common/rules/Rule.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/Rule.js +1 -0
- package/lib/cjs/presentation-common/rules/Rule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/CustomizationRule.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/CustomizationRule.js +1 -0
- package/lib/cjs/presentation-common/rules/customization/CustomizationRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/GroupingRule.d.ts +18 -0
- package/lib/cjs/presentation-common/rules/customization/GroupingRule.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/GroupingRule.js +5 -0
- package/lib/cjs/presentation-common/rules/customization/GroupingRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeRule.d.ts +2 -0
- package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeRule.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeRule.js +1 -0
- package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeSpecification.d.ts +8 -0
- package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeSpecification.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeSpecification.js +3 -0
- package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/CustomNodeSpecification.d.ts +2 -0
- package/lib/cjs/presentation-common/rules/hierarchy/CustomNodeSpecification.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/CustomNodeSpecification.js +1 -0
- package/lib/cjs/presentation-common/rules/hierarchy/CustomNodeSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.d.ts +12 -0
- package/lib/cjs/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js +3 -0
- package/lib/cjs/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts +2 -0
- package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js +1 -0
- package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/NavigationRule.d.ts +4 -0
- package/lib/cjs/presentation-common/rules/hierarchy/NavigationRule.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/NavigationRule.js +1 -0
- package/lib/cjs/presentation-common/rules/hierarchy/NavigationRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/NodeArtifactsRule.d.ts +2 -0
- package/lib/cjs/presentation-common/rules/hierarchy/NodeArtifactsRule.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/NodeArtifactsRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.d.ts +2 -0
- package/lib/cjs/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js +1 -0
- package/lib/cjs/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/RootNodeRule.d.ts +2 -0
- package/lib/cjs/presentation-common/rules/hierarchy/RootNodeRule.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/RootNodeRule.js +1 -0
- package/lib/cjs/presentation-common/rules/hierarchy/RootNodeRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/SubCondition.d.ts +2 -0
- package/lib/cjs/presentation-common/rules/hierarchy/SubCondition.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/SubCondition.js +1 -0
- package/lib/cjs/presentation-common/rules/hierarchy/SubCondition.js.map +1 -1
- package/lib/esm/presentation-common/KeySet.d.ts +22 -7
- package/lib/esm/presentation-common/KeySet.d.ts.map +1 -1
- package/lib/esm/presentation-common/KeySet.js +29 -38
- package/lib/esm/presentation-common/KeySet.js.map +1 -1
- package/lib/esm/presentation-common/KoqPropertyValueFormatter.d.ts +2 -0
- package/lib/esm/presentation-common/KoqPropertyValueFormatter.d.ts.map +1 -1
- package/lib/esm/presentation-common/KoqPropertyValueFormatter.js +2 -2
- package/lib/esm/presentation-common/KoqPropertyValueFormatter.js.map +1 -1
- package/lib/esm/presentation-common/LocalizationHelper.d.ts +1 -1
- package/lib/esm/presentation-common/LocalizationHelper.d.ts.map +1 -1
- package/lib/esm/presentation-common/LocalizationHelper.js +9 -7
- package/lib/esm/presentation-common/LocalizationHelper.js.map +1 -1
- package/lib/esm/presentation-common/PresentationManagerOptions.d.ts +10 -0
- package/lib/esm/presentation-common/PresentationManagerOptions.d.ts.map +1 -1
- package/lib/esm/presentation-common/PresentationManagerOptions.js.map +1 -1
- package/lib/esm/presentation-common/PresentationRpcInterface.d.ts +8 -0
- package/lib/esm/presentation-common/PresentationRpcInterface.d.ts.map +1 -1
- package/lib/esm/presentation-common/PresentationRpcInterface.js +1 -2
- package/lib/esm/presentation-common/PresentationRpcInterface.js.map +1 -1
- package/lib/esm/presentation-common/RpcRequestsHandler.d.ts.map +1 -1
- package/lib/esm/presentation-common/RpcRequestsHandler.js +2 -16
- package/lib/esm/presentation-common/RpcRequestsHandler.js.map +1 -1
- package/lib/esm/presentation-common/Update.d.ts +16 -0
- package/lib/esm/presentation-common/Update.d.ts.map +1 -1
- package/lib/esm/presentation-common/Update.js +1 -0
- package/lib/esm/presentation-common/Update.js.map +1 -1
- package/lib/esm/presentation-common/Utils.d.ts.map +1 -1
- package/lib/esm/presentation-common/Utils.js +2 -0
- package/lib/esm/presentation-common/Utils.js.map +1 -1
- package/lib/esm/presentation-common/content/ContentTraverser.d.ts.map +1 -1
- package/lib/esm/presentation-common/content/ContentTraverser.js +14 -10
- package/lib/esm/presentation-common/content/ContentTraverser.js.map +1 -1
- package/lib/esm/presentation-common/content/PropertyValueFormatter.d.ts.map +1 -1
- package/lib/esm/presentation-common/content/PropertyValueFormatter.js +6 -1
- package/lib/esm/presentation-common/content/PropertyValueFormatter.js.map +1 -1
- package/lib/esm/presentation-common/hierarchy/HierarchyLevel.d.ts +2 -0
- package/lib/esm/presentation-common/hierarchy/HierarchyLevel.d.ts.map +1 -1
- package/lib/esm/presentation-common/hierarchy/HierarchyLevel.js +1 -0
- package/lib/esm/presentation-common/hierarchy/HierarchyLevel.js.map +1 -1
- package/lib/esm/presentation-common/hierarchy/Key.d.ts +23 -1
- package/lib/esm/presentation-common/hierarchy/Key.d.ts.map +1 -1
- package/lib/esm/presentation-common/hierarchy/Key.js +8 -1
- package/lib/esm/presentation-common/hierarchy/Key.js.map +1 -1
- package/lib/esm/presentation-common/hierarchy/Node.d.ts +4 -0
- package/lib/esm/presentation-common/hierarchy/Node.d.ts.map +1 -1
- package/lib/esm/presentation-common/hierarchy/Node.js +1 -0
- package/lib/esm/presentation-common/hierarchy/Node.js.map +1 -1
- package/lib/esm/presentation-common/hierarchy/NodePathElement.d.ts +4 -0
- package/lib/esm/presentation-common/hierarchy/NodePathElement.d.ts.map +1 -1
- package/lib/esm/presentation-common/hierarchy/NodePathElement.js +1 -0
- package/lib/esm/presentation-common/hierarchy/NodePathElement.js.map +1 -1
- package/lib/esm/presentation-common/rules/Rule.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/Rule.js +1 -0
- package/lib/esm/presentation-common/rules/Rule.js.map +1 -1
- package/lib/esm/presentation-common/rules/customization/CustomizationRule.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/customization/CustomizationRule.js +1 -0
- package/lib/esm/presentation-common/rules/customization/CustomizationRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/customization/GroupingRule.d.ts +18 -0
- package/lib/esm/presentation-common/rules/customization/GroupingRule.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/customization/GroupingRule.js +5 -0
- package/lib/esm/presentation-common/rules/customization/GroupingRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/ChildNodeRule.d.ts +2 -0
- package/lib/esm/presentation-common/rules/hierarchy/ChildNodeRule.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/ChildNodeRule.js +1 -0
- package/lib/esm/presentation-common/rules/hierarchy/ChildNodeRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/ChildNodeSpecification.d.ts +8 -0
- package/lib/esm/presentation-common/rules/hierarchy/ChildNodeSpecification.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/ChildNodeSpecification.js +3 -0
- package/lib/esm/presentation-common/rules/hierarchy/ChildNodeSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/CustomNodeSpecification.d.ts +2 -0
- package/lib/esm/presentation-common/rules/hierarchy/CustomNodeSpecification.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/CustomNodeSpecification.js +1 -0
- package/lib/esm/presentation-common/rules/hierarchy/CustomNodeSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.d.ts +12 -0
- package/lib/esm/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js +3 -0
- package/lib/esm/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts +2 -0
- package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js +1 -0
- package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/NavigationRule.d.ts +4 -0
- package/lib/esm/presentation-common/rules/hierarchy/NavigationRule.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/NavigationRule.js +1 -0
- package/lib/esm/presentation-common/rules/hierarchy/NavigationRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/NodeArtifactsRule.d.ts +2 -0
- package/lib/esm/presentation-common/rules/hierarchy/NodeArtifactsRule.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/NodeArtifactsRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.d.ts +2 -0
- package/lib/esm/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js +1 -0
- package/lib/esm/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/RootNodeRule.d.ts +2 -0
- package/lib/esm/presentation-common/rules/hierarchy/RootNodeRule.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/RootNodeRule.js +1 -0
- package/lib/esm/presentation-common/rules/hierarchy/RootNodeRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/SubCondition.d.ts +2 -0
- package/lib/esm/presentation-common/rules/hierarchy/SubCondition.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/SubCondition.js +1 -0
- package/lib/esm/presentation-common/rules/hierarchy/SubCondition.js.map +1 -1
- package/package.json +11 -11
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
4
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
5
|
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
/* eslint-disable @typescript-eslint/no-deprecated */
|
|
6
7
|
/** @packageDocumentation
|
|
7
8
|
* @module RPC
|
|
8
9
|
*/
|
|
@@ -90,15 +91,12 @@ class RpcRequestsHandler {
|
|
|
90
91
|
return result;
|
|
91
92
|
}
|
|
92
93
|
async getNodesCount(options) {
|
|
93
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
94
94
|
return this.request(this.rpcClient.getNodesCount.bind(this.rpcClient), options);
|
|
95
95
|
}
|
|
96
96
|
async getPagedNodes(options) {
|
|
97
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
98
97
|
return this.request(this.rpcClient.getPagedNodes.bind(this.rpcClient), options);
|
|
99
98
|
}
|
|
100
99
|
async getNodesDescriptor(options) {
|
|
101
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
102
100
|
const response = await this.request(this.rpcClient.getNodesDescriptor.bind(this.rpcClient), options);
|
|
103
101
|
if (typeof response === "string") {
|
|
104
102
|
return JSON.parse(response);
|
|
@@ -106,48 +104,36 @@ class RpcRequestsHandler {
|
|
|
106
104
|
return response;
|
|
107
105
|
}
|
|
108
106
|
async getNodePaths(options) {
|
|
109
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
110
107
|
return this.request(this.rpcClient.getNodePaths.bind(this.rpcClient), options);
|
|
111
108
|
}
|
|
112
109
|
async getFilteredNodePaths(options) {
|
|
113
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
114
110
|
return this.request(this.rpcClient.getFilteredNodePaths.bind(this.rpcClient), options);
|
|
115
111
|
}
|
|
116
112
|
async getContentSources(options) {
|
|
117
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
118
113
|
return this.request(this.rpcClient.getContentSources.bind(this.rpcClient), options);
|
|
119
114
|
}
|
|
120
115
|
async getContentDescriptor(options) {
|
|
121
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
122
116
|
return this.request(this.rpcClient.getContentDescriptor.bind(this.rpcClient), options);
|
|
123
117
|
}
|
|
124
118
|
async getContentSetSize(options) {
|
|
125
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
126
119
|
return this.request(this.rpcClient.getContentSetSize.bind(this.rpcClient), options);
|
|
127
120
|
}
|
|
128
121
|
async getPagedContent(options) {
|
|
129
|
-
return this.request(
|
|
130
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
131
|
-
this.rpcClient.getPagedContent.bind(this.rpcClient), options);
|
|
122
|
+
return this.request(this.rpcClient.getPagedContent.bind(this.rpcClient), options);
|
|
132
123
|
}
|
|
133
124
|
async getPagedContentSet(options) {
|
|
134
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
135
125
|
return this.request(this.rpcClient.getPagedContentSet.bind(this.rpcClient), options);
|
|
136
126
|
}
|
|
137
127
|
async getPagedDistinctValues(options) {
|
|
138
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
139
128
|
return this.request(this.rpcClient.getPagedDistinctValues.bind(this.rpcClient), options);
|
|
140
129
|
}
|
|
141
130
|
async getContentInstanceKeys(options) {
|
|
142
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
143
131
|
return this.request(this.rpcClient.getContentInstanceKeys.bind(this.rpcClient), options);
|
|
144
132
|
}
|
|
145
133
|
async getDisplayLabelDefinition(options) {
|
|
146
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
147
134
|
return this.request(this.rpcClient.getDisplayLabelDefinition.bind(this.rpcClient), options);
|
|
148
135
|
}
|
|
149
136
|
async getPagedDisplayLabelDefinitions(options) {
|
|
150
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
151
137
|
return this.request(this.rpcClient.getPagedDisplayLabelDefinitions.bind(this.rpcClient), options);
|
|
152
138
|
}
|
|
153
139
|
/* eslint-disable @typescript-eslint/no-deprecated */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RpcRequestsHandler.js","sourceRoot":"","sources":["../../../src/presentation-common/RpcRequestsHandler.ts"],"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AAO,EAAE,IAAI;IACb,eAAe,EAAE,IAAI;IACrB,mBAAmB,EAAE,IAAI;IACzB,IAAI,EAAE,IAAI;CACX,CAAC;AAEF,SAAS,cAAc,CAAC,OAAgB;IACtC,MAAM,gBAAgB,GAAY,EAAE,GAAG,OAAO,EAAE,CAAC;IAEjD,KAAK,MAAM,WAAW,IAAI,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAE,CAAC;QACxD,IAAI,CAAC,gCAAgC,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,CAAC;YAClE,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;gBAC9B,OAAQ,gBAAwB,CAAC,WAAW,CAAC,CAAC;YAChD,CAAC;iBAAM,CAAC;gBACN,qBAAM,CAAC,UAAU,CACf,0DAAgC,CAAC,OAAO,EACxC,qDAAqD,WAAW,2DAA2D,CAC5H,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,gBAAgB,CAAC;AAC1B,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module RPC\n */\n\nimport { Guid, Logger } from \"@itwin/core-bentley\";\nimport { IModelRpcProps, RpcManager, RpcRequest } from \"@itwin/core-common\";\nimport { PresentationCommonLoggerCategory } from \"./CommonLoggerCategory.js\";\nimport { DescriptorJSON, DescriptorOverrides } from \"./content/Descriptor.js\";\nimport { ItemJSON } from \"./content/Item.js\";\nimport { ClientDiagnostics, ClientDiagnosticsAttribute, ClientDiagnosticsHandler } from \"./Diagnostics.js\";\nimport { InstanceKey } from \"./EC.js\";\nimport { PresentationError, PresentationStatus } from \"./Error.js\";\nimport { NodeKey } from \"./hierarchy/Key.js\";\nimport { Node } from \"./hierarchy/Node.js\";\nimport { KeySetJSON } from \"./KeySet.js\";\nimport { LabelDefinition } from \"./LabelDefinition.js\";\nimport {\n ComputeSelectionRequestOptions,\n ContentDescriptorRequestOptions,\n ContentInstanceKeysRequestOptions,\n ContentRequestOptions,\n ContentSourcesRequestOptions,\n DisplayLabelRequestOptions,\n DisplayLabelsRequestOptions,\n DistinctValuesRequestOptions,\n FilterByInstancePathsHierarchyRequestOptions,\n FilterByTextHierarchyRequestOptions,\n HierarchyLevelDescriptorRequestOptions,\n HierarchyRequestOptions,\n Paged,\n RequestOptions,\n RequestOptionsWithRuleset,\n SelectionScopeRequestOptions,\n} from \"./PresentationManagerOptions.js\";\nimport { ContentSourcesRpcResult, PresentationRpcInterface, PresentationRpcRequestOptions, PresentationRpcResponse } from \"./PresentationRpcInterface.js\";\nimport { Ruleset } from \"./rules/Ruleset.js\";\nimport { RulesetVariableJSON } from \"./RulesetVariables.js\";\nimport { SelectionScope } from \"./selection/SelectionScope.js\";\nimport { createCancellableTimeoutPromise, PagedResponse } from \"./Utils.js\";\nimport { NodePathElement } from \"./hierarchy/NodePathElement.js\";\nimport { DisplayValueGroup } from \"./content/Value.js\";\n\n/**\n * Default timeout for how long we're going to wait for RPC request to be fulfilled before throwing\n * a timeout error.\n */\nconst DEFAULT_REQUEST_TIMEOUT = 10 * 60 * 1000; // 10 minutes\n\n/**\n * Configuration parameters for [[RpcRequestsHandler]].\n *\n * @internal\n */\nexport interface RpcRequestsHandlerProps {\n /**\n * Optional ID used to identify client that requests data. If not specified,\n * the handler creates a unique GUID as a client id.\n * @internal\n */\n clientId?: string;\n\n /** @internal */\n timeout?: number;\n}\n\n/**\n * RPC requests handler that wraps [[PresentationRpcInterface]] and\n * adds handling for cases when backend needs to be synced with client\n * state.\n *\n * @internal\n */\nexport class RpcRequestsHandler {\n /** Timeout for how long the handler going to wait for RPC request to be fulfilled before throwing a timeout error. */\n public readonly timeout: number;\n\n /** ID that identifies this handler as a client */\n public readonly clientId: string;\n\n public constructor(props?: RpcRequestsHandlerProps) {\n this.clientId = props?.clientId ?? Guid.createValue();\n this.timeout = props?.timeout ?? DEFAULT_REQUEST_TIMEOUT;\n }\n\n // eslint-disable-next-line @typescript-eslint/naming-convention\n private get rpcClient(): PresentationRpcInterface {\n return RpcManager.getClientForInterface(PresentationRpcInterface);\n }\n\n private async requestWithTimeout<TResult>(func: () => PresentationRpcResponse<TResult>, diagnosticsHandler?: ClientDiagnosticsHandler): Promise<TResult> {\n const rpcResponsePromise = func();\n const rpcRequest: RpcRequest | undefined = RpcRequest.current(this.rpcClient);\n const timeout = createCancellableTimeoutPromise(this.timeout);\n return Promise.race([\n (async () => {\n let diagnostics: ClientDiagnostics | undefined;\n try {\n const response = await rpcResponsePromise;\n diagnostics = response.diagnostics;\n switch (response.statusCode) {\n case PresentationStatus.Success:\n return response.result!;\n default:\n throw new PresentationError(response.statusCode, response.errorMessage);\n }\n } finally {\n diagnosticsHandler && diagnostics && diagnosticsHandler(diagnostics);\n }\n })(),\n timeout.promise.then(() => {\n throw new Error(`Processing the request took longer than the configured limit of ${this.timeout} ms`);\n }),\n ]).finally(() => {\n rpcRequest?.cancel();\n timeout.cancel();\n });\n }\n\n /**\n * Send the request to backend. We'll wait for the response for `this.timeout` ms, and if we don't get the response by\n * then, we'll throw an error.\n */\n public async request<TResult, TOptions extends RequestOptions<IModelRpcProps> & ClientDiagnosticsAttribute, TArg = any>(\n func: (token: IModelRpcProps, options: PresentationRpcRequestOptions<TOptions>, ...args: TArg[]) => PresentationRpcResponse<TResult>,\n options: TOptions,\n ...additionalOptions: TArg[]\n ): Promise<TResult> {\n const { imodel, diagnostics, ...optionsNoIModel } = options;\n const { handler: diagnosticsHandler, ...diagnosticsOptions } = diagnostics ?? {};\n if (isOptionsWithRuleset(optionsNoIModel)) {\n optionsNoIModel.rulesetOrId = cleanupRuleset(optionsNoIModel.rulesetOrId);\n }\n const rpcOptions: PresentationRpcRequestOptions<TOptions> = {\n ...optionsNoIModel,\n clientId: this.clientId,\n };\n if (diagnostics) {\n rpcOptions.diagnostics = diagnosticsOptions;\n }\n const doRequest = async () => func(imodel, rpcOptions, ...additionalOptions);\n const result = await this.requestWithTimeout(doRequest, diagnosticsHandler);\n return result;\n }\n\n public async getNodesCount(options: HierarchyRequestOptions<IModelRpcProps, NodeKey, RulesetVariableJSON> & ClientDiagnosticsAttribute): Promise<number> {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return this.request<number, typeof options>(this.rpcClient.getNodesCount.bind(this.rpcClient), options);\n }\n\n public async getPagedNodes(\n options: Paged<HierarchyRequestOptions<IModelRpcProps, NodeKey, RulesetVariableJSON>> & ClientDiagnosticsAttribute,\n ): Promise<PagedResponse<Node>> {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return this.request<PagedResponse<Node>, typeof options>(this.rpcClient.getPagedNodes.bind(this.rpcClient), options);\n }\n\n public async getNodesDescriptor(\n options: HierarchyLevelDescriptorRequestOptions<IModelRpcProps, NodeKey, RulesetVariableJSON> & ClientDiagnosticsAttribute,\n ): Promise<DescriptorJSON | undefined> {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const response = await this.request<string | DescriptorJSON | undefined, typeof options>(this.rpcClient.getNodesDescriptor.bind(this.rpcClient), options);\n if (typeof response === \"string\") {\n return JSON.parse(response);\n }\n return response;\n }\n\n public async getNodePaths(\n options: FilterByInstancePathsHierarchyRequestOptions<IModelRpcProps, RulesetVariableJSON> & ClientDiagnosticsAttribute,\n ): Promise<NodePathElement[]> {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return this.request<NodePathElement[], typeof options>(this.rpcClient.getNodePaths.bind(this.rpcClient), options);\n }\n\n public async getFilteredNodePaths(\n options: FilterByTextHierarchyRequestOptions<IModelRpcProps, RulesetVariableJSON> & ClientDiagnosticsAttribute,\n ): Promise<NodePathElement[]> {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return this.request<NodePathElement[], typeof options>(this.rpcClient.getFilteredNodePaths.bind(this.rpcClient), options);\n }\n\n public async getContentSources(options: ContentSourcesRequestOptions<IModelRpcProps> & ClientDiagnosticsAttribute): Promise<ContentSourcesRpcResult> {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return this.request<ContentSourcesRpcResult, typeof options>(this.rpcClient.getContentSources.bind(this.rpcClient), options);\n }\n public async getContentDescriptor(\n options: ContentDescriptorRequestOptions<IModelRpcProps, KeySetJSON, RulesetVariableJSON> & ClientDiagnosticsAttribute,\n ): Promise<DescriptorJSON | undefined> {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return this.request<DescriptorJSON | undefined, typeof options>(this.rpcClient.getContentDescriptor.bind(this.rpcClient), options);\n }\n public async getContentSetSize(\n options: ContentRequestOptions<IModelRpcProps, DescriptorOverrides, KeySetJSON, RulesetVariableJSON> & ClientDiagnosticsAttribute,\n ): Promise<number> {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return this.request<number, typeof options>(this.rpcClient.getContentSetSize.bind(this.rpcClient), options);\n }\n public async getPagedContent(\n options: Paged<ContentRequestOptions<IModelRpcProps, DescriptorOverrides, KeySetJSON, RulesetVariableJSON> & ClientDiagnosticsAttribute>,\n ) {\n return this.request<{ descriptor: DescriptorJSON; contentSet: PagedResponse<ItemJSON> } | undefined, typeof options>(\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n this.rpcClient.getPagedContent.bind(this.rpcClient),\n options,\n );\n }\n public async getPagedContentSet(\n options: Paged<ContentRequestOptions<IModelRpcProps, DescriptorOverrides, KeySetJSON, RulesetVariableJSON> & ClientDiagnosticsAttribute>,\n ) {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return this.request<PagedResponse<ItemJSON>, typeof options>(this.rpcClient.getPagedContentSet.bind(this.rpcClient), options);\n }\n\n public async getPagedDistinctValues(\n options: DistinctValuesRequestOptions<IModelRpcProps, DescriptorOverrides, KeySetJSON, RulesetVariableJSON> & ClientDiagnosticsAttribute,\n ): Promise<PagedResponse<DisplayValueGroup>> {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return this.request<PagedResponse<DisplayValueGroup>, typeof options>(this.rpcClient.getPagedDistinctValues.bind(this.rpcClient), options);\n }\n\n public async getContentInstanceKeys(\n options: ContentInstanceKeysRequestOptions<IModelRpcProps, KeySetJSON, RulesetVariableJSON> & ClientDiagnosticsAttribute,\n ): Promise<{ total: number; items: KeySetJSON }> {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return this.request<{ total: number; items: KeySetJSON }, typeof options>(this.rpcClient.getContentInstanceKeys.bind(this.rpcClient), options);\n }\n\n public async getDisplayLabelDefinition(\n options: DisplayLabelRequestOptions<IModelRpcProps, InstanceKey> & ClientDiagnosticsAttribute,\n ): Promise<LabelDefinition> {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return this.request<LabelDefinition, typeof options>(this.rpcClient.getDisplayLabelDefinition.bind(this.rpcClient), options);\n }\n public async getPagedDisplayLabelDefinitions(\n options: DisplayLabelsRequestOptions<IModelRpcProps, InstanceKey> & ClientDiagnosticsAttribute,\n ): Promise<PagedResponse<LabelDefinition>> {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return this.request<PagedResponse<LabelDefinition>, typeof options>(this.rpcClient.getPagedDisplayLabelDefinitions.bind(this.rpcClient), options);\n }\n\n /* eslint-disable @typescript-eslint/no-deprecated */\n public async getSelectionScopes(options: SelectionScopeRequestOptions<IModelRpcProps> & ClientDiagnosticsAttribute): Promise<SelectionScope[]> {\n return this.request<SelectionScope[], typeof options>(this.rpcClient.getSelectionScopes.bind(this.rpcClient), options);\n }\n public async computeSelection(options: ComputeSelectionRequestOptions<IModelRpcProps> & ClientDiagnosticsAttribute): Promise<KeySetJSON> {\n return this.request<KeySetJSON, typeof options>(this.rpcClient.computeSelection.bind(this.rpcClient), options);\n }\n /* eslint-enable @typescript-eslint/no-deprecated */\n}\n\nfunction isOptionsWithRuleset(options: object): options is { rulesetOrId: Ruleset } {\n return typeof (options as RequestOptionsWithRuleset<any, any>).rulesetOrId === \"object\";\n}\n\ntype RulesetWithRequiredProperties = {\n [key in keyof Ruleset]-?: true;\n};\n\nconst RULESET_SUPPORTED_PROPERTIES_OBJ: RulesetWithRequiredProperties = {\n id: true,\n rules: true,\n version: true,\n requiredSchemas: true,\n supplementationInfo: true,\n vars: true,\n};\n\nfunction cleanupRuleset(ruleset: Ruleset): Ruleset {\n const cleanedUpRuleset: Ruleset = { ...ruleset };\n\n for (const propertyKey of Object.keys(cleanedUpRuleset)) {\n if (!RULESET_SUPPORTED_PROPERTIES_OBJ.hasOwnProperty(propertyKey)) {\n if (propertyKey === \"$schema\") {\n delete (cleanedUpRuleset as any)[propertyKey];\n } else {\n Logger.logWarning(\n PresentationCommonLoggerCategory.Package,\n `Provided ruleset contains unrecognized attribute '${propertyKey}'. It either doesn't exist or may be no longer supported.`,\n );\n }\n }\n }\n\n return cleanedUpRuleset;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"RpcRequestsHandler.js","sourceRoot":"","sources":["../../../src/presentation-common/RpcRequestsHandler.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG,qDAAqD;AACrD;;GAEG;;;AAEH,sDAAmD;AACnD,oDAA4E;AAC5E,uEAA6E;AAK7E,yCAAmE;AAuBnE,+EAA0J;AAI1J,yCAA4E;AAI5E;;;GAGG;AACH,MAAM,uBAAuB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,aAAa;AAmB7D;;;;;;GAMG;AACH,MAAa,kBAAkB;IAC7B,sHAAsH;IACtG,OAAO,CAAS;IAEhC,kDAAkD;IAClC,QAAQ,CAAS;IAEjC,YAAmB,KAA+B;QAChD,IAAI,CAAC,QAAQ,GAAG,KAAK,EAAE,QAAQ,IAAI,mBAAI,CAAC,WAAW,EAAE,CAAC;QACtD,IAAI,CAAC,OAAO,GAAG,KAAK,EAAE,OAAO,IAAI,uBAAuB,CAAC;IAC3D,CAAC;IAED,gEAAgE;IAChE,IAAY,SAAS;QACnB,OAAO,wBAAU,CAAC,qBAAqB,CAAC,sDAAwB,CAAC,CAAC;IACpE,CAAC;IAEO,KAAK,CAAC,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AAC,OAAoF;QAChH,OAAO,IAAI,CAAC,OAAO,CAA6B,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,CAAC;IACjH,CAAC;CAEF;AAlKD,gDAkKC;AAED,SAAS,oBAAoB,CAAC,OAAe;IAC3C,OAAO,OAAQ,OAA+C,CAAC,WAAW,KAAK,QAAQ,CAAC;AAC1F,CAAC;AAMD,MAAM,gCAAgC,GAAkC;IACtE,EAAE,EAAE,IAAI;IACR,KAAK,EAAE,IAAI;IACX,OAAO,EAAE,IAAI;IACb,eAAe,EAAE,IAAI;IACrB,mBAAmB,EAAE,IAAI;IACzB,IAAI,EAAE,IAAI;CACX,CAAC;AAEF,SAAS,cAAc,CAAC,OAAgB;IACtC,MAAM,gBAAgB,GAAY,EAAE,GAAG,OAAO,EAAE,CAAC;IAEjD,KAAK,MAAM,WAAW,IAAI,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAE,CAAC;QACxD,IAAI,CAAC,gCAAgC,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,CAAC;YAClE,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;gBAC9B,OAAQ,gBAAwB,CAAC,WAAW,CAAC,CAAC;YAChD,CAAC;iBAAM,CAAC;gBACN,qBAAM,CAAC,UAAU,CACf,0DAAgC,CAAC,OAAO,EACxC,qDAAqD,WAAW,2DAA2D,CAC5H,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,gBAAgB,CAAC;AAC1B,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/* eslint-disable @typescript-eslint/no-deprecated */\n/** @packageDocumentation\n * @module RPC\n */\n\nimport { Guid, Logger } from \"@itwin/core-bentley\";\nimport { IModelRpcProps, RpcManager, RpcRequest } from \"@itwin/core-common\";\nimport { PresentationCommonLoggerCategory } from \"./CommonLoggerCategory.js\";\nimport { DescriptorJSON, DescriptorOverrides } from \"./content/Descriptor.js\";\nimport { ItemJSON } from \"./content/Item.js\";\nimport { ClientDiagnostics, ClientDiagnosticsAttribute, ClientDiagnosticsHandler } from \"./Diagnostics.js\";\nimport { InstanceKey } from \"./EC.js\";\nimport { PresentationError, PresentationStatus } from \"./Error.js\";\nimport { NodeKey } from \"./hierarchy/Key.js\";\nimport { Node } from \"./hierarchy/Node.js\";\nimport { KeySetJSON } from \"./KeySet.js\";\nimport { LabelDefinition } from \"./LabelDefinition.js\";\nimport {\n ComputeSelectionRequestOptions,\n ContentDescriptorRequestOptions,\n ContentInstanceKeysRequestOptions,\n ContentRequestOptions,\n ContentSourcesRequestOptions,\n DisplayLabelRequestOptions,\n DisplayLabelsRequestOptions,\n DistinctValuesRequestOptions,\n FilterByInstancePathsHierarchyRequestOptions,\n FilterByTextHierarchyRequestOptions,\n HierarchyLevelDescriptorRequestOptions,\n HierarchyRequestOptions,\n Paged,\n RequestOptions,\n RequestOptionsWithRuleset,\n SelectionScopeRequestOptions,\n} from \"./PresentationManagerOptions.js\";\nimport { ContentSourcesRpcResult, PresentationRpcInterface, PresentationRpcRequestOptions, PresentationRpcResponse } from \"./PresentationRpcInterface.js\";\nimport { Ruleset } from \"./rules/Ruleset.js\";\nimport { RulesetVariableJSON } from \"./RulesetVariables.js\";\nimport { SelectionScope } from \"./selection/SelectionScope.js\";\nimport { createCancellableTimeoutPromise, PagedResponse } from \"./Utils.js\";\nimport { NodePathElement } from \"./hierarchy/NodePathElement.js\";\nimport { DisplayValueGroup } from \"./content/Value.js\";\n\n/**\n * Default timeout for how long we're going to wait for RPC request to be fulfilled before throwing\n * a timeout error.\n */\nconst DEFAULT_REQUEST_TIMEOUT = 10 * 60 * 1000; // 10 minutes\n\n/**\n * Configuration parameters for [[RpcRequestsHandler]].\n *\n * @internal\n */\nexport interface RpcRequestsHandlerProps {\n /**\n * Optional ID used to identify client that requests data. If not specified,\n * the handler creates a unique GUID as a client id.\n * @internal\n */\n clientId?: string;\n\n /** @internal */\n timeout?: number;\n}\n\n/**\n * RPC requests handler that wraps [[PresentationRpcInterface]] and\n * adds handling for cases when backend needs to be synced with client\n * state.\n *\n * @internal\n */\nexport class RpcRequestsHandler {\n /** Timeout for how long the handler going to wait for RPC request to be fulfilled before throwing a timeout error. */\n public readonly timeout: number;\n\n /** ID that identifies this handler as a client */\n public readonly clientId: string;\n\n public constructor(props?: RpcRequestsHandlerProps) {\n this.clientId = props?.clientId ?? Guid.createValue();\n this.timeout = props?.timeout ?? DEFAULT_REQUEST_TIMEOUT;\n }\n\n // eslint-disable-next-line @typescript-eslint/naming-convention\n private get rpcClient(): PresentationRpcInterface {\n return RpcManager.getClientForInterface(PresentationRpcInterface);\n }\n\n private async requestWithTimeout<TResult>(func: () => PresentationRpcResponse<TResult>, diagnosticsHandler?: ClientDiagnosticsHandler): Promise<TResult> {\n const rpcResponsePromise = func();\n const rpcRequest: RpcRequest | undefined = RpcRequest.current(this.rpcClient);\n const timeout = createCancellableTimeoutPromise(this.timeout);\n return Promise.race([\n (async () => {\n let diagnostics: ClientDiagnostics | undefined;\n try {\n const response = await rpcResponsePromise;\n diagnostics = response.diagnostics;\n switch (response.statusCode) {\n case PresentationStatus.Success:\n return response.result!;\n default:\n throw new PresentationError(response.statusCode, response.errorMessage);\n }\n } finally {\n diagnosticsHandler && diagnostics && diagnosticsHandler(diagnostics);\n }\n })(),\n timeout.promise.then(() => {\n throw new Error(`Processing the request took longer than the configured limit of ${this.timeout} ms`);\n }),\n ]).finally(() => {\n rpcRequest?.cancel();\n timeout.cancel();\n });\n }\n\n /**\n * Send the request to backend. We'll wait for the response for `this.timeout` ms, and if we don't get the response by\n * then, we'll throw an error.\n */\n public async request<TResult, TOptions extends RequestOptions<IModelRpcProps> & ClientDiagnosticsAttribute, TArg = any>(\n func: (token: IModelRpcProps, options: PresentationRpcRequestOptions<TOptions>, ...args: TArg[]) => PresentationRpcResponse<TResult>,\n options: TOptions,\n ...additionalOptions: TArg[]\n ): Promise<TResult> {\n const { imodel, diagnostics, ...optionsNoIModel } = options;\n const { handler: diagnosticsHandler, ...diagnosticsOptions } = diagnostics ?? {};\n if (isOptionsWithRuleset(optionsNoIModel)) {\n optionsNoIModel.rulesetOrId = cleanupRuleset(optionsNoIModel.rulesetOrId);\n }\n const rpcOptions: PresentationRpcRequestOptions<TOptions> = {\n ...optionsNoIModel,\n clientId: this.clientId,\n };\n if (diagnostics) {\n rpcOptions.diagnostics = diagnosticsOptions;\n }\n const doRequest = async () => func(imodel, rpcOptions, ...additionalOptions);\n const result = await this.requestWithTimeout(doRequest, diagnosticsHandler);\n return result;\n }\n\n public async getNodesCount(options: HierarchyRequestOptions<IModelRpcProps, NodeKey, RulesetVariableJSON> & ClientDiagnosticsAttribute): Promise<number> {\n return this.request<number, typeof options>(this.rpcClient.getNodesCount.bind(this.rpcClient), options);\n }\n\n public async getPagedNodes(\n options: Paged<HierarchyRequestOptions<IModelRpcProps, NodeKey, RulesetVariableJSON>> & ClientDiagnosticsAttribute,\n ): Promise<PagedResponse<Node>> {\n return this.request<PagedResponse<Node>, typeof options>(this.rpcClient.getPagedNodes.bind(this.rpcClient), options);\n }\n\n public async getNodesDescriptor(\n options: HierarchyLevelDescriptorRequestOptions<IModelRpcProps, NodeKey, RulesetVariableJSON> & ClientDiagnosticsAttribute,\n ): Promise<DescriptorJSON | undefined> {\n const response = await this.request<string | DescriptorJSON | undefined, typeof options>(this.rpcClient.getNodesDescriptor.bind(this.rpcClient), options);\n if (typeof response === \"string\") {\n return JSON.parse(response);\n }\n return response;\n }\n\n public async getNodePaths(\n options: FilterByInstancePathsHierarchyRequestOptions<IModelRpcProps, RulesetVariableJSON> & ClientDiagnosticsAttribute,\n ): Promise<NodePathElement[]> {\n return this.request<NodePathElement[], typeof options>(this.rpcClient.getNodePaths.bind(this.rpcClient), options);\n }\n\n public async getFilteredNodePaths(\n options: FilterByTextHierarchyRequestOptions<IModelRpcProps, RulesetVariableJSON> & ClientDiagnosticsAttribute,\n ): Promise<NodePathElement[]> {\n return this.request<NodePathElement[], typeof options>(this.rpcClient.getFilteredNodePaths.bind(this.rpcClient), options);\n }\n\n public async getContentSources(options: ContentSourcesRequestOptions<IModelRpcProps> & ClientDiagnosticsAttribute): Promise<ContentSourcesRpcResult> {\n return this.request<ContentSourcesRpcResult, typeof options>(this.rpcClient.getContentSources.bind(this.rpcClient), options);\n }\n public async getContentDescriptor(\n options: ContentDescriptorRequestOptions<IModelRpcProps, KeySetJSON, RulesetVariableJSON> & ClientDiagnosticsAttribute,\n ): Promise<DescriptorJSON | undefined> {\n return this.request<DescriptorJSON | undefined, typeof options>(this.rpcClient.getContentDescriptor.bind(this.rpcClient), options);\n }\n public async getContentSetSize(\n options: ContentRequestOptions<IModelRpcProps, DescriptorOverrides, KeySetJSON, RulesetVariableJSON> & ClientDiagnosticsAttribute,\n ): Promise<number> {\n return this.request<number, typeof options>(this.rpcClient.getContentSetSize.bind(this.rpcClient), options);\n }\n public async getPagedContent(\n options: Paged<ContentRequestOptions<IModelRpcProps, DescriptorOverrides, KeySetJSON, RulesetVariableJSON> & ClientDiagnosticsAttribute>,\n ) {\n return this.request<{ descriptor: DescriptorJSON; contentSet: PagedResponse<ItemJSON> } | undefined, typeof options>(\n this.rpcClient.getPagedContent.bind(this.rpcClient),\n options,\n );\n }\n public async getPagedContentSet(\n options: Paged<ContentRequestOptions<IModelRpcProps, DescriptorOverrides, KeySetJSON, RulesetVariableJSON> & ClientDiagnosticsAttribute>,\n ) {\n return this.request<PagedResponse<ItemJSON>, typeof options>(this.rpcClient.getPagedContentSet.bind(this.rpcClient), options);\n }\n\n public async getPagedDistinctValues(\n options: DistinctValuesRequestOptions<IModelRpcProps, DescriptorOverrides, KeySetJSON, RulesetVariableJSON> & ClientDiagnosticsAttribute,\n ): Promise<PagedResponse<DisplayValueGroup>> {\n return this.request<PagedResponse<DisplayValueGroup>, typeof options>(this.rpcClient.getPagedDistinctValues.bind(this.rpcClient), options);\n }\n\n public async getContentInstanceKeys(\n options: ContentInstanceKeysRequestOptions<IModelRpcProps, KeySetJSON, RulesetVariableJSON> & ClientDiagnosticsAttribute,\n ): Promise<{ total: number; items: KeySetJSON }> {\n return this.request<{ total: number; items: KeySetJSON }, typeof options>(this.rpcClient.getContentInstanceKeys.bind(this.rpcClient), options);\n }\n\n public async getDisplayLabelDefinition(\n options: DisplayLabelRequestOptions<IModelRpcProps, InstanceKey> & ClientDiagnosticsAttribute,\n ): Promise<LabelDefinition> {\n return this.request<LabelDefinition, typeof options>(this.rpcClient.getDisplayLabelDefinition.bind(this.rpcClient), options);\n }\n public async getPagedDisplayLabelDefinitions(\n options: DisplayLabelsRequestOptions<IModelRpcProps, InstanceKey> & ClientDiagnosticsAttribute,\n ): Promise<PagedResponse<LabelDefinition>> {\n return this.request<PagedResponse<LabelDefinition>, typeof options>(this.rpcClient.getPagedDisplayLabelDefinitions.bind(this.rpcClient), options);\n }\n\n /* eslint-disable @typescript-eslint/no-deprecated */\n public async getSelectionScopes(options: SelectionScopeRequestOptions<IModelRpcProps> & ClientDiagnosticsAttribute): Promise<SelectionScope[]> {\n return this.request<SelectionScope[], typeof options>(this.rpcClient.getSelectionScopes.bind(this.rpcClient), options);\n }\n public async computeSelection(options: ComputeSelectionRequestOptions<IModelRpcProps> & ClientDiagnosticsAttribute): Promise<KeySetJSON> {\n return this.request<KeySetJSON, typeof options>(this.rpcClient.computeSelection.bind(this.rpcClient), options);\n }\n /* eslint-enable @typescript-eslint/no-deprecated */\n}\n\nfunction isOptionsWithRuleset(options: object): options is { rulesetOrId: Ruleset } {\n return typeof (options as RequestOptionsWithRuleset<any, any>).rulesetOrId === \"object\";\n}\n\ntype RulesetWithRequiredProperties = {\n [key in keyof Ruleset]-?: true;\n};\n\nconst RULESET_SUPPORTED_PROPERTIES_OBJ: RulesetWithRequiredProperties = {\n id: true,\n rules: true,\n version: true,\n requiredSchemas: true,\n supplementationInfo: true,\n vars: true,\n};\n\nfunction cleanupRuleset(ruleset: Ruleset): Ruleset {\n const cleanedUpRuleset: Ruleset = { ...ruleset };\n\n for (const propertyKey of Object.keys(cleanedUpRuleset)) {\n if (!RULESET_SUPPORTED_PROPERTIES_OBJ.hasOwnProperty(propertyKey)) {\n if (propertyKey === \"$schema\") {\n delete (cleanedUpRuleset as any)[propertyKey];\n } else {\n Logger.logWarning(\n PresentationCommonLoggerCategory.Package,\n `Provided ruleset contains unrecognized attribute '${propertyKey}'. It either doesn't exist or may be no longer supported.`,\n );\n }\n }\n }\n\n return cleanedUpRuleset;\n}\n"]}
|
|
@@ -17,6 +17,10 @@ export declare const UPDATE_FULL = "FULL";
|
|
|
17
17
|
export interface UpdateInfo {
|
|
18
18
|
[imodel: string]: {
|
|
19
19
|
[rulesetId: string]: {
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
22
|
+
* package for creating hierarchies.
|
|
23
|
+
*/
|
|
20
24
|
hierarchy?: HierarchyUpdateInfo;
|
|
21
25
|
content?: ContentUpdateInfo;
|
|
22
26
|
};
|
|
@@ -25,6 +29,8 @@ export interface UpdateInfo {
|
|
|
25
29
|
/**
|
|
26
30
|
* Information about a required hierarchy update.
|
|
27
31
|
* @public
|
|
32
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
33
|
+
* package for creating hierarchies.
|
|
28
34
|
*/
|
|
29
35
|
export type HierarchyUpdateInfo = typeof UPDATE_FULL;
|
|
30
36
|
/**
|
|
@@ -35,11 +41,15 @@ export type ContentUpdateInfo = typeof UPDATE_FULL;
|
|
|
35
41
|
/**
|
|
36
42
|
* Information about a hierarchy change: insertion, deletion or node update.
|
|
37
43
|
* @public
|
|
44
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
45
|
+
* package for creating hierarchies.
|
|
38
46
|
*/
|
|
39
47
|
export type PartialHierarchyModification = NodeInsertionInfo | NodeDeletionInfo | NodeUpdateInfo;
|
|
40
48
|
/**
|
|
41
49
|
* Information about node insertion.
|
|
42
50
|
* @public
|
|
51
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
52
|
+
* package for creating hierarchies.
|
|
43
53
|
*/
|
|
44
54
|
export interface NodeInsertionInfo {
|
|
45
55
|
type: "Insert";
|
|
@@ -53,6 +63,8 @@ export interface NodeInsertionInfo {
|
|
|
53
63
|
/**
|
|
54
64
|
* Information about node deletion.
|
|
55
65
|
* @public
|
|
66
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
67
|
+
* package for creating hierarchies.
|
|
56
68
|
*/
|
|
57
69
|
export interface NodeDeletionInfo {
|
|
58
70
|
type: "Delete";
|
|
@@ -64,6 +76,8 @@ export interface NodeDeletionInfo {
|
|
|
64
76
|
/**
|
|
65
77
|
* Information about node update.
|
|
66
78
|
* @public
|
|
79
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
80
|
+
* package for creating hierarchies.
|
|
67
81
|
*/
|
|
68
82
|
export interface NodeUpdateInfo {
|
|
69
83
|
type: "Update";
|
|
@@ -75,6 +89,8 @@ export interface NodeUpdateInfo {
|
|
|
75
89
|
/**
|
|
76
90
|
* Information about hierarchy modification / differences.
|
|
77
91
|
* @public
|
|
92
|
+
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
93
|
+
* package for creating hierarchies.
|
|
78
94
|
*/
|
|
79
95
|
export interface HierarchyCompareInfo {
|
|
80
96
|
/** A list of hierarchy changes */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Update.d.ts","sourceRoot":"","sources":["../../../src/presentation-common/Update.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Update.d.ts","sourceRoot":"","sources":["../../../src/presentation-common/Update.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAExD;;;GAGG;AACH,eAAO,MAAM,WAAW,SAAS,CAAC;AAElC;;;;;GAKG;AACH,MAAM,WAAW,UAAU;IACzB,CAAC,MAAM,EAAE,MAAM,GAAG;QAChB,CAAC,SAAS,EAAE,MAAM,GAAG;YACnB;;;eAGG;YACH,SAAS,CAAC,EAAE,mBAAmB,CAAC;YAChC,OAAO,CAAC,EAAE,iBAAiB,CAAC;SAC7B,CAAC;KACH,CAAC;CACH;AAED;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,GAAG,OAAO,WAAW,CAAC;AAErD;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,OAAO,WAAW,CAAC;AAEnD;;;;;GAKG;AACH,MAAM,MAAM,4BAA4B,GAAG,iBAAiB,GAAG,gBAAgB,GAAG,cAAc,CAAC;AAEjG;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,QAAQ,CAAC;IACf,sBAAsB;IACtB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,6CAA6C;IAC7C,QAAQ,EAAE,MAAM,CAAC;IACjB,oBAAoB;IACpB,IAAI,EAAE,IAAI,CAAC;CACZ;AAED;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,QAAQ,CAAC;IACf,iCAAiC;IACjC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,uFAAuF;IACvF,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,QAAQ,CAAC;IACf,8BAA8B;IAC9B,MAAM,EAAE,OAAO,CAAC;IAChB,8BAA8B;IAC9B,OAAO,EAAE,WAAW,CAAC;CACtB;AAED;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC,kCAAkC;IAClC,OAAO,EAAE,4BAA4B,EAAE,CAAC;IACxC,sDAAsD;IACtD,iBAAiB,CAAC,EAAE;QAClB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,iBAAiB,EAAE,MAAM,CAAC;KAC3B,CAAC;CACH"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
4
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
5
|
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
/* eslint-disable @typescript-eslint/no-deprecated */
|
|
6
7
|
/** @packageDocumentation
|
|
7
8
|
* @module Core
|
|
8
9
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Update.js","sourceRoot":"","sources":["../../../src/presentation-common/Update.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAKH;;;GAGG;AACU,QAAA,WAAW,GAAG,MAAM,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Core\n */\n\nimport { NodeKey } from \"./hierarchy/Key.js\";\nimport { Node, PartialNode } from \"./hierarchy/Node.js\";\n\n/**\n * A constant for indicating that a full update is required.\n * @public\n */\nexport const UPDATE_FULL = \"FULL\";\n\n/**\n * A data structure that describes changes that need to be applied to the hierarchy and\n * content components due to some changes on the backend.\n *\n * @public\n */\nexport interface UpdateInfo {\n [imodel: string]: {\n [rulesetId: string]: {\n hierarchy?: HierarchyUpdateInfo;\n content?: ContentUpdateInfo;\n };\n };\n}\n\n/**\n * Information about a required hierarchy update.\n * @public\n */\nexport type HierarchyUpdateInfo = typeof UPDATE_FULL;\n\n/**\n * Information about a required content update.\n * @public\n */\nexport type ContentUpdateInfo = typeof UPDATE_FULL;\n\n/**\n * Information about a hierarchy change: insertion, deletion or node update.\n * @public\n */\nexport type PartialHierarchyModification = NodeInsertionInfo | NodeDeletionInfo | NodeUpdateInfo;\n\n/**\n * Information about node insertion.\n * @public\n */\nexport interface NodeInsertionInfo {\n type: \"Insert\";\n /** Parent node key */\n parent?: NodeKey;\n /** Index of the new node under its parent */\n position: number;\n /** Inserted node */\n node: Node;\n}\n\n/**\n * Information about node deletion.\n * @public\n */\nexport interface NodeDeletionInfo {\n type: \"Delete\";\n /** Parent of the deleted node */\n parent?: NodeKey;\n /** Position of the deleted node among its siblings in the initial, not updated tree */\n position: number;\n}\n\n/**\n * Information about node update.\n * @public\n */\nexport interface NodeUpdateInfo {\n type: \"Update\";\n /** Key of the updated node */\n target: NodeKey;\n /** Updated node attributes */\n changes: PartialNode;\n}\n\n/**\n * Information about hierarchy modification / differences.\n * @public\n */\nexport interface HierarchyCompareInfo {\n /** A list of hierarchy changes */\n changes: PartialHierarchyModification[];\n /** Continuation token for requesting more changes. */\n continuationToken?: {\n prevHierarchyNode: string;\n currHierarchyNode: string;\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Update.js","sourceRoot":"","sources":["../../../src/presentation-common/Update.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG,qDAAqD;AACrD;;GAEG;;;AAKH;;;GAGG;AACU,QAAA,WAAW,GAAG,MAAM,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/* eslint-disable @typescript-eslint/no-deprecated */\n/** @packageDocumentation\n * @module Core\n */\n\nimport { NodeKey } from \"./hierarchy/Key.js\";\nimport { Node, PartialNode } from \"./hierarchy/Node.js\";\n\n/**\n * A constant for indicating that a full update is required.\n * @public\n */\nexport const UPDATE_FULL = \"FULL\";\n\n/**\n * A data structure that describes changes that need to be applied to the hierarchy and\n * content components due to some changes on the backend.\n *\n * @public\n */\nexport interface UpdateInfo {\n [imodel: string]: {\n [rulesetId: string]: {\n /**\n * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\n hierarchy?: HierarchyUpdateInfo;\n content?: ContentUpdateInfo;\n };\n };\n}\n\n/**\n * Information about a required hierarchy update.\n * @public\n * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\nexport type HierarchyUpdateInfo = typeof UPDATE_FULL;\n\n/**\n * Information about a required content update.\n * @public\n */\nexport type ContentUpdateInfo = typeof UPDATE_FULL;\n\n/**\n * Information about a hierarchy change: insertion, deletion or node update.\n * @public\n * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\nexport type PartialHierarchyModification = NodeInsertionInfo | NodeDeletionInfo | NodeUpdateInfo;\n\n/**\n * Information about node insertion.\n * @public\n * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\nexport interface NodeInsertionInfo {\n type: \"Insert\";\n /** Parent node key */\n parent?: NodeKey;\n /** Index of the new node under its parent */\n position: number;\n /** Inserted node */\n node: Node;\n}\n\n/**\n * Information about node deletion.\n * @public\n * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\nexport interface NodeDeletionInfo {\n type: \"Delete\";\n /** Parent of the deleted node */\n parent?: NodeKey;\n /** Position of the deleted node among its siblings in the initial, not updated tree */\n position: number;\n}\n\n/**\n * Information about node update.\n * @public\n * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\nexport interface NodeUpdateInfo {\n type: \"Update\";\n /** Key of the updated node */\n target: NodeKey;\n /** Updated node attributes */\n changes: PartialNode;\n}\n\n/**\n * Information about hierarchy modification / differences.\n * @public\n * @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\nexport interface HierarchyCompareInfo {\n /** A list of hierarchy changes */\n changes: PartialHierarchyModification[];\n /** Continuation token for requesting more changes. */\n continuationToken?: {\n prevHierarchyNode: string;\n currHierarchyNode: string;\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Utils.d.ts","sourceRoot":"","sources":["../../../src/presentation-common/Utils.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC;;;;;;GAMG;AACH,MAAM,MAAM,IAAI,CAAC,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAEtD;;;;;;GAMG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;AAE9C;;;GAGG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,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GAWG;AACH,eAAO,MAAM,iBAAiB,SAAU,QAAQ,CAAC,MAAM,CAAC,KAAG,MAY1D,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,OAAO,CAAC;AAE5C;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAOzD;AAED,gBAAgB;AAChB,KAAK,eAAe,CAAC,CAAC,IAAI,CAAC,SAAS,IAAI,GACpC,SAAS,GACT,CAAC,SAAS,KAAK,CAAC,MAAM,CAAC,CAAC,GACtB,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,GACzB,CAAC,SAAS,MAAM,GACd;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GACzC,CAAC,CAAC;AAEV,gBAAgB;AAChB,wBAAgB,2BAA2B,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,CAmBzE;AAED,gBAAgB;AAChB,wBAAgB,+BAA+B,CAAC,SAAS,EAAE,MAAM;;;EAchE"}
|
|
@@ -26,6 +26,7 @@ const Key_js_1 = require("./hierarchy/Key.js");
|
|
|
26
26
|
*/
|
|
27
27
|
const getInstancesCount = (keys) => {
|
|
28
28
|
let count = keys.instanceKeysCount;
|
|
29
|
+
/* eslint-disable @typescript-eslint/no-deprecated */
|
|
29
30
|
keys.nodeKeys.forEach((key) => {
|
|
30
31
|
if (Key_js_1.NodeKey.isInstancesNodeKey(key)) {
|
|
31
32
|
count += key.instanceKeys.length;
|
|
@@ -34,6 +35,7 @@ const getInstancesCount = (keys) => {
|
|
|
34
35
|
count += key.groupedInstancesCount;
|
|
35
36
|
}
|
|
36
37
|
});
|
|
38
|
+
/* eslint-enable @typescript-eslint/no-deprecated */
|
|
37
39
|
return count;
|
|
38
40
|
};
|
|
39
41
|
exports.getInstancesCount = getInstancesCount;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Utils.js","sourceRoot":"","sources":["../../../src/presentation-common/Utils.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;
|
|
1
|
+
{"version":3,"file":"Utils.js","sourceRoot":"","sources":["../../../src/presentation-common/Utils.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AA0FH,sCAOC;AAYD,kEAmBC;AAGD,0EAcC;AA/ID,+CAA6C;AA8C7C;;;;;;;;;;;GAWG;AACI,MAAM,iBAAiB,GAAG,CAAC,IAAsB,EAAU,EAAE;IAClE,IAAI,KAAK,GAAG,IAAI,CAAC,iBAAiB,CAAC;IACnC,qDAAqD;IACrD,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,GAAY,EAAE,EAAE;QACrC,IAAI,gBAAO,CAAC,kBAAkB,CAAC,GAAG,CAAC,EAAE,CAAC;YACpC,KAAK,IAAI,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC;QACnC,CAAC;aAAM,IAAI,gBAAO,CAAC,iBAAiB,CAAC,GAAG,CAAC,EAAE,CAAC;YAC1C,KAAK,IAAI,GAAG,CAAC,qBAAqB,CAAC;QACrC,CAAC;IACH,CAAC,CAAC,CAAC;IACH,oDAAoD;IACpD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAZW,QAAA,iBAAiB,qBAY5B;AAEF;;;;;GAKG;AACU,QAAA,uBAAuB,GAAG,IAAI,CAAC;AAE5C;;;;;;;GAOG;AACH,SAAgB,aAAa,CAAmB,GAAM;IACpD,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QAC3C,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,OAAO,GAAG,CAAC,GAAc,CAAC,CAAC;QAC7B,CAAC;IACH,CAAC,CAAC,CAAC;IACH,OAAO,GAAG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------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Core\n */\n\nimport { NodeKey } from \"./hierarchy/Key.js\";\nimport { KeySet } from \"./KeySet.js\";\n\n/**\n * Create a type with `T` properties excluding properties listed in `K`.\n *\n * Usage example: `Omit<SomeType, \"exclude_prop1\" | \"exclude_prop2\">`\n *\n * @public\n */\nexport type Omit<T, K> = Pick<T, Exclude<keyof T, K>>;\n\n/**\n * Create a type with `T` properties excluding all properties in type `K`.\n *\n * Usage example: `Subtract<SomeType, ExcludePropertiesInThisType>`\n *\n * @public\n */\nexport type Subtract<T, K> = Omit<T, keyof K>;\n\n/**\n * Create a type from given type `T` and make specified properties optional.\n * @public\n */\nexport type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;\n\n/**\n * A dictionary data structure.\n * @public\n */\nexport interface ValuesDictionary<T> {\n [key: string]: T;\n}\n\n/**\n * A structure for paged responses\n * @public\n */\nexport interface PagedResponse<T> {\n /** Total number of items */\n total: number;\n /** Items for the requested page */\n items: T[];\n}\n\n/**\n * Get total number of instances included in the supplied key set. The\n * count is calculated by adding all of the following:\n * - `keys.instanceKeysCount`\n * - number of `keys.nodeKeys` which are *ECInstance* keys\n * - for every grouping node key in `keys.nodeKeys`, number of grouped instances\n *\n * E.g. if `keys` contains one instance key, one *ECInstance* node key\n * and one grouping node key which groups 3 instances, the result is 5.\n *\n * @public\n */\nexport const getInstancesCount = (keys: Readonly<KeySet>): number => {\n let count = keys.instanceKeysCount;\n /* eslint-disable @typescript-eslint/no-deprecated */\n keys.nodeKeys.forEach((key: NodeKey) => {\n if (NodeKey.isInstancesNodeKey(key)) {\n count += key.instanceKeys.length;\n } else if (NodeKey.isGroupingNodeKey(key)) {\n count += key.groupedInstancesCount;\n }\n });\n /* eslint-enable @typescript-eslint/no-deprecated */\n return count;\n};\n\n/**\n * Default (recommended) keyset batch size for cases when it needs to be sent\n * over HTTP. Sending keys in batches helps avoid HTTP413 error.\n *\n * @public\n */\nexport const DEFAULT_KEYS_BATCH_SIZE = 5000;\n\n/**\n * Removes all `undefined` properties from given `obj` object and returns\n * the same (mutated) object.\n *\n * Example: `omitUndefined({ a: 1, b: undefined })` will return `{ a: 1 }`\n *\n * @internal\n */\nexport function omitUndefined<T extends object>(obj: T): T {\n Object.entries(obj).forEach(([key, value]) => {\n if (value === undefined) {\n delete obj[key as keyof T];\n }\n });\n return obj;\n}\n\n/** @internal */\ntype NullToUndefined<T> = T extends null\n ? undefined\n : T extends Array<infer U>\n ? Array<NullToUndefined<U>>\n : T extends object\n ? { [K in keyof T]: NullToUndefined<T[K]> }\n : T;\n\n/** @internal */\nexport function deepReplaceNullsToUndefined<T>(obj: T): NullToUndefined<T> {\n /* c8 ignore next 3 */\n if (obj === null) {\n return undefined as any;\n }\n /* c8 ignore next 3 */\n if (Array.isArray(obj)) {\n return obj.map(deepReplaceNullsToUndefined) as NullToUndefined<T>;\n }\n if (typeof obj === \"object\") {\n return Object.keys(obj).reduce((acc, key) => {\n const value = obj[key as keyof T];\n if (value !== null && value !== undefined) {\n acc[key as keyof NullToUndefined<T>] = deepReplaceNullsToUndefined(value) as any;\n }\n return acc;\n }, {} as NullToUndefined<T>);\n }\n return obj as any;\n}\n\n/** @internal */\nexport function createCancellableTimeoutPromise(timeoutMs: number) {\n let timeout: ReturnType<typeof setTimeout>;\n let rejectPromise: () => void;\n const promise = new Promise<void>((resolve, reject) => {\n rejectPromise = reject;\n timeout = setTimeout(resolve, timeoutMs);\n });\n return {\n promise,\n cancel: () => {\n clearTimeout(timeout);\n rejectPromise();\n },\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentTraverser.d.ts","sourceRoot":"","sources":["../../../../src/presentation-common/content/ContentTraverser.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,eAAe,EAAE,M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AK,EAAE,cAAc,GAAG,OAAO,CAAC;IAC1C;;;OAGG;IACH,UAAU,IAAI,IAAI,CAAC;IAEnB;;;;;OAKG;IACH,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC;IAClD,qGAAqG;IACrG,cAAc,IAAI,IAAI,CAAC;IAEvB;;;;;OAKG;IACH,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC;IAC5C,gFAAgF;IAChF,WAAW,IAAI,IAAI,CAAC;IAEpB;;;;;OAKG;IACH,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC;IAC9C,2DAA2D;IAC3D,YAAY,IAAI,IAAI,CAAC;IAErB;;;;;OAKG;IACH,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC;IAC5C,0DAA0D;IAC1D,WAAW,IAAI,IAAI,CAAC;IAEpB,mGAAmG;IACnG,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,GAAG,IAAI,CAAC;IACzD,2CAA2C;IAC3C,qBAAqB,CAAC,KAAK,EAAE,0BAA0B,GAAG,IAAI,CAAC;CAChE;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,cAAc,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,cAAc,KAAK,OAAO,QAInG;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,OAAO,QAczE;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,QAE/F;
|
|
1
|
+
{"version":3,"file":"ContentTraverser.d.ts","sourceRoot":"","sources":["../../../../src/presentation-common/content/ContentTraverser.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,eA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AM,CAAC;AACzC;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,MAAM,UAE5E;AACD;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,YAAY,EAAE,MAAM,YAE3D"}
|
|
@@ -268,17 +268,21 @@ function traverseContentItemStructFieldValue(visitor, fieldHierarchy, mergedFiel
|
|
|
268
268
|
valueType.members.forEach((memberDescription) => {
|
|
269
269
|
let memberField = fieldHierarchy.childFields.find((f) => f.field.name === memberDescription.name);
|
|
270
270
|
if (!memberField) {
|
|
271
|
-
// Not finding a member field means we're traversing an ECStruct.
|
|
272
|
-
// create
|
|
271
|
+
// Not finding a member field means we're traversing an ECStruct. If current field is `StructPropertiesField`
|
|
272
|
+
// try looking up member field in there. Otherwise, just create fake field to propagate information.
|
|
273
|
+
const structMemberField = fieldHierarchy.field.isPropertiesField() && fieldHierarchy.field.isStructPropertiesField()
|
|
274
|
+
? fieldHierarchy.field.memberFields.find((mf) => mf.name === memberDescription.name)
|
|
275
|
+
: undefined;
|
|
273
276
|
memberField = {
|
|
274
|
-
field:
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
277
|
+
field: structMemberField ??
|
|
278
|
+
new Fields_js_1.Field({
|
|
279
|
+
category: fieldHierarchy.field.category,
|
|
280
|
+
name: memberDescription.name,
|
|
281
|
+
label: memberDescription.label,
|
|
282
|
+
type: memberDescription.type,
|
|
283
|
+
isReadonly: fieldHierarchy.field.isReadonly,
|
|
284
|
+
priority: 0,
|
|
285
|
+
}),
|
|
282
286
|
childFields: [],
|
|
283
287
|
};
|
|
284
288
|
}
|