@itwin/presentation-shared 1.0.0 → 1.1.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 +15 -0
- package/README.md +2 -0
- package/lib/cjs/package.json +1 -0
- package/lib/cjs/presentation-shared.d.ts +11 -11
- package/lib/cjs/presentation-shared.d.ts.map +1 -1
- package/lib/cjs/presentation-shared.js +29 -29
- package/lib/cjs/presentation-shared.js.map +1 -1
- package/lib/cjs/shared/ConcatenatedValue.d.ts +9 -9
- package/lib/cjs/shared/ConcatenatedValue.d.ts.map +1 -1
- package/lib/cjs/shared/ConcatenatedValue.js +6 -6
- package/lib/cjs/shared/ConcatenatedValue.js.map +1 -1
- package/lib/cjs/shared/ECSqlCore.d.ts +7 -7
- package/lib/cjs/shared/Event.d.ts +1 -1
- package/lib/cjs/shared/Formatting.d.ts +5 -5
- package/lib/cjs/shared/Formatting.d.ts.map +1 -1
- package/lib/cjs/shared/Formatting.js +7 -7
- package/lib/cjs/shared/Formatting.js.map +1 -1
- package/lib/cjs/shared/InstanceLabelSelectClauseFactory.d.ts +12 -12
- package/lib/cjs/shared/InstanceLabelSelectClauseFactory.d.ts.map +1 -1
- package/lib/cjs/shared/InstanceLabelSelectClauseFactory.js +17 -17
- package/lib/cjs/shared/InstanceLabelSelectClauseFactory.js.map +1 -1
- package/lib/cjs/shared/Logging.d.ts +4 -4
- package/lib/cjs/shared/Logging.js +2 -2
- package/lib/cjs/shared/Logging.js.map +1 -1
- package/lib/cjs/shared/MappedTypes.d.ts +2 -2
- package/lib/cjs/shared/Metadata.d.ts +31 -31
- package/lib/cjs/shared/Metadata.js +4 -4
- package/lib/cjs/shared/Metadata.js.map +1 -1
- package/lib/cjs/shared/Utils.d.ts +11 -6
- package/lib/cjs/shared/Utils.d.ts.map +1 -1
- package/lib/cjs/shared/Utils.js +15 -6
- package/lib/cjs/shared/Utils.js.map +1 -1
- package/lib/cjs/shared/Values.d.ts +13 -13
- package/lib/cjs/shared/Values.d.ts.map +1 -1
- package/lib/cjs/shared/Values.js +7 -7
- package/lib/cjs/shared/Values.js.map +1 -1
- package/lib/cjs/shared/ecsql-snippets/ECSqlJoinSnippets.d.ts +5 -5
- package/lib/cjs/shared/ecsql-snippets/ECSqlJoinSnippets.d.ts.map +1 -1
- package/lib/cjs/shared/ecsql-snippets/ECSqlJoinSnippets.js +18 -20
- package/lib/cjs/shared/ecsql-snippets/ECSqlJoinSnippets.js.map +1 -1
- package/lib/cjs/shared/ecsql-snippets/ECSqlValueSelectorSnippets.d.ts +12 -12
- package/lib/cjs/shared/ecsql-snippets/ECSqlValueSelectorSnippets.d.ts.map +1 -1
- package/lib/cjs/shared/ecsql-snippets/ECSqlValueSelectorSnippets.js +22 -22
- package/lib/cjs/shared/ecsql-snippets/ECSqlValueSelectorSnippets.js.map +1 -1
- package/lib/cjs/shared/ecsql-snippets/index.d.ts +2 -2
- package/lib/cjs/shared/ecsql-snippets/index.d.ts.map +1 -1
- package/lib/cjs/shared/ecsql-snippets/index.js +10 -10
- package/lib/cjs/shared/ecsql-snippets/index.js.map +1 -1
- package/lib/esm/presentation-shared.d.ts +11 -11
- package/lib/esm/presentation-shared.d.ts.map +1 -1
- package/lib/esm/presentation-shared.js +8 -9
- package/lib/esm/presentation-shared.js.map +1 -1
- package/lib/esm/shared/ConcatenatedValue.d.ts +9 -9
- package/lib/esm/shared/ConcatenatedValue.d.ts.map +1 -1
- package/lib/esm/shared/ConcatenatedValue.js +6 -6
- package/lib/esm/shared/ConcatenatedValue.js.map +1 -1
- package/lib/esm/shared/ECSqlCore.d.ts +7 -7
- package/lib/esm/shared/Event.d.ts +1 -1
- package/lib/esm/shared/Formatting.d.ts +5 -5
- package/lib/esm/shared/Formatting.d.ts.map +1 -1
- package/lib/esm/shared/Formatting.js +4 -4
- package/lib/esm/shared/Formatting.js.map +1 -1
- package/lib/esm/shared/InstanceLabelSelectClauseFactory.d.ts +12 -12
- package/lib/esm/shared/InstanceLabelSelectClauseFactory.d.ts.map +1 -1
- package/lib/esm/shared/InstanceLabelSelectClauseFactory.js +5 -5
- package/lib/esm/shared/InstanceLabelSelectClauseFactory.js.map +1 -1
- package/lib/esm/shared/Logging.d.ts +4 -4
- package/lib/esm/shared/Logging.js +2 -2
- package/lib/esm/shared/Logging.js.map +1 -1
- package/lib/esm/shared/MappedTypes.d.ts +2 -2
- package/lib/esm/shared/Metadata.d.ts +31 -31
- package/lib/esm/shared/Metadata.js +3 -3
- package/lib/esm/shared/Metadata.js.map +1 -1
- package/lib/esm/shared/Utils.d.ts +11 -6
- package/lib/esm/shared/Utils.d.ts.map +1 -1
- package/lib/esm/shared/Utils.js +14 -6
- package/lib/esm/shared/Utils.js.map +1 -1
- package/lib/esm/shared/Values.d.ts +13 -13
- package/lib/esm/shared/Values.d.ts.map +1 -1
- package/lib/esm/shared/Values.js +7 -7
- package/lib/esm/shared/Values.js.map +1 -1
- package/lib/esm/shared/ecsql-snippets/ECSqlJoinSnippets.d.ts +5 -5
- package/lib/esm/shared/ecsql-snippets/ECSqlJoinSnippets.d.ts.map +1 -1
- package/lib/esm/shared/ecsql-snippets/ECSqlJoinSnippets.js +3 -5
- package/lib/esm/shared/ecsql-snippets/ECSqlJoinSnippets.js.map +1 -1
- package/lib/esm/shared/ecsql-snippets/ECSqlValueSelectorSnippets.d.ts +12 -12
- package/lib/esm/shared/ecsql-snippets/ECSqlValueSelectorSnippets.d.ts.map +1 -1
- package/lib/esm/shared/ecsql-snippets/ECSqlValueSelectorSnippets.js +15 -15
- package/lib/esm/shared/ecsql-snippets/ECSqlValueSelectorSnippets.js.map +1 -1
- package/lib/esm/shared/ecsql-snippets/index.d.ts +2 -2
- package/lib/esm/shared/ecsql-snippets/index.d.ts.map +1 -1
- package/lib/esm/shared/ecsql-snippets/index.js +2 -2
- package/lib/esm/shared/ecsql-snippets/index.js.map +1 -1
- package/package.json +20 -12
- package/lib/cjs/shared/InternalUtils.d.ts +0 -3
- package/lib/cjs/shared/InternalUtils.d.ts.map +0 -1
- package/lib/cjs/shared/InternalUtils.js +0 -13
- package/lib/cjs/shared/InternalUtils.js.map +0 -1
- package/lib/esm/shared/InternalUtils.d.ts +0 -3
- package/lib/esm/shared/InternalUtils.d.ts.map +0 -1
- package/lib/esm/shared/InternalUtils.js +0 -10
- package/lib/esm/shared/InternalUtils.js.map +0 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* An interface for an object that knows how to get an ECSchema from an iModel.
|
|
3
3
|
*
|
|
4
4
|
* @see `createECSchemaProvider` in `@itwin/presentation-core-interop`.
|
|
5
|
-
* @
|
|
5
|
+
* @public
|
|
6
6
|
*/
|
|
7
7
|
export interface ECSchemaProvider {
|
|
8
8
|
getSchema(schemaName: string): Promise<EC.Schema | undefined>;
|
|
@@ -10,14 +10,14 @@ export interface ECSchemaProvider {
|
|
|
10
10
|
/**
|
|
11
11
|
* An interface for a class hierarchy inspector that can be used to determine if one class derives from another.
|
|
12
12
|
* @see `createCachingECClassHierarchyInspector`
|
|
13
|
-
* @
|
|
13
|
+
* @public
|
|
14
14
|
*/
|
|
15
15
|
export interface ECClassHierarchyInspector {
|
|
16
16
|
classDerivesFrom(derivedClassFullName: string, candidateBaseClassFullName: string): Promise<boolean> | boolean;
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
19
|
* Creates a new `ECClassHierarchyInspector` that caches results of `derivesFrom` calls.
|
|
20
|
-
* @
|
|
20
|
+
* @public
|
|
21
21
|
*/
|
|
22
22
|
export declare function createCachingECClassHierarchyInspector(props: {
|
|
23
23
|
/** Schema provider used to load schemas and their classes. */
|
|
@@ -27,14 +27,14 @@ export declare function createCachingECClassHierarchyInspector(props: {
|
|
|
27
27
|
}): ECClassHierarchyInspector;
|
|
28
28
|
/**
|
|
29
29
|
* A namespace containing various [EC types](https://www.itwinjs.org/bis/ec/).
|
|
30
|
-
* @
|
|
30
|
+
* @public
|
|
31
31
|
* @see `ECSchemaProvider`
|
|
32
32
|
*/
|
|
33
33
|
export declare namespace EC {
|
|
34
34
|
/**
|
|
35
35
|
* Represents an ECSchema that contains classes, relationships, etc.
|
|
36
36
|
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/schema/
|
|
37
|
-
* @
|
|
37
|
+
* @public
|
|
38
38
|
*/
|
|
39
39
|
interface Schema {
|
|
40
40
|
name: string;
|
|
@@ -43,7 +43,7 @@ export declare namespace EC {
|
|
|
43
43
|
/**
|
|
44
44
|
* Represents an ECSchema item - a class, relationship, etc.
|
|
45
45
|
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/schemaitem/
|
|
46
|
-
* @
|
|
46
|
+
* @public
|
|
47
47
|
*/
|
|
48
48
|
interface SchemaItem {
|
|
49
49
|
schema: Schema;
|
|
@@ -54,7 +54,7 @@ export declare namespace EC {
|
|
|
54
54
|
/**
|
|
55
55
|
* Represents an ECClass.
|
|
56
56
|
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/ecclass/
|
|
57
|
-
* @
|
|
57
|
+
* @public
|
|
58
58
|
*/
|
|
59
59
|
interface Class extends SchemaItem {
|
|
60
60
|
is(className: string, schemaName: string): Promise<boolean>;
|
|
@@ -69,31 +69,31 @@ export declare namespace EC {
|
|
|
69
69
|
/**
|
|
70
70
|
* Represents an entity class.
|
|
71
71
|
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/entityclass/
|
|
72
|
-
* @
|
|
72
|
+
* @public
|
|
73
73
|
*/
|
|
74
74
|
type EntityClass = Class;
|
|
75
75
|
/**
|
|
76
76
|
* Represents a struct class.
|
|
77
77
|
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/structclass/
|
|
78
|
-
* @
|
|
78
|
+
* @public
|
|
79
79
|
*/
|
|
80
80
|
type StructClass = Class;
|
|
81
81
|
/**
|
|
82
82
|
* Represents a mixin.
|
|
83
83
|
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/mixin/
|
|
84
|
-
* @
|
|
84
|
+
* @public
|
|
85
85
|
*/
|
|
86
86
|
type Mixin = Class;
|
|
87
87
|
/**
|
|
88
88
|
* Represents a kind of quantity.
|
|
89
89
|
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/kindofquantity/
|
|
90
|
-
* @
|
|
90
|
+
* @public
|
|
91
91
|
*/
|
|
92
92
|
type KindOfQuantity = SchemaItem;
|
|
93
93
|
/**
|
|
94
94
|
* Represents a relationship constraint multiplicity.
|
|
95
95
|
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/relationshipmultiplicity/
|
|
96
|
-
* @
|
|
96
|
+
* @public
|
|
97
97
|
*/
|
|
98
98
|
interface RelationshipConstraintMultiplicity {
|
|
99
99
|
lowerLimit: number;
|
|
@@ -102,7 +102,7 @@ export declare namespace EC {
|
|
|
102
102
|
/**
|
|
103
103
|
* Represents a relationship constraint.
|
|
104
104
|
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/relationshipconstraint/
|
|
105
|
-
* @
|
|
105
|
+
* @public
|
|
106
106
|
*/
|
|
107
107
|
interface RelationshipConstraint {
|
|
108
108
|
multiplicity?: RelationshipConstraintMultiplicity;
|
|
@@ -112,7 +112,7 @@ export declare namespace EC {
|
|
|
112
112
|
/**
|
|
113
113
|
* Represents a relationship class.
|
|
114
114
|
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/relationshipclass/
|
|
115
|
-
* @
|
|
115
|
+
* @public
|
|
116
116
|
*/
|
|
117
117
|
interface RelationshipClass extends Class {
|
|
118
118
|
direction: "Forward" | "Backward";
|
|
@@ -122,7 +122,7 @@ export declare namespace EC {
|
|
|
122
122
|
/**
|
|
123
123
|
* Represents an enumerator.
|
|
124
124
|
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/enumerator/
|
|
125
|
-
* @
|
|
125
|
+
* @public
|
|
126
126
|
*/
|
|
127
127
|
interface Enumerator<T> {
|
|
128
128
|
name: string;
|
|
@@ -133,7 +133,7 @@ export declare namespace EC {
|
|
|
133
133
|
/**
|
|
134
134
|
* Represents an enumeration.
|
|
135
135
|
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/enumeration/
|
|
136
|
-
* @
|
|
136
|
+
* @public
|
|
137
137
|
*/
|
|
138
138
|
interface Enumeration extends SchemaItem {
|
|
139
139
|
enumerators: Array<Enumerator<string | number>>;
|
|
@@ -143,7 +143,7 @@ export declare namespace EC {
|
|
|
143
143
|
/**
|
|
144
144
|
* Represents a property.
|
|
145
145
|
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/property/
|
|
146
|
-
* @
|
|
146
|
+
* @public
|
|
147
147
|
*/
|
|
148
148
|
interface Property {
|
|
149
149
|
name: string;
|
|
@@ -159,7 +159,7 @@ export declare namespace EC {
|
|
|
159
159
|
/**
|
|
160
160
|
* Defines array property attributes.
|
|
161
161
|
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/arrayproperty/
|
|
162
|
-
* @
|
|
162
|
+
* @public
|
|
163
163
|
*/
|
|
164
164
|
interface ArrayPropertyAttributes {
|
|
165
165
|
minOccurs: number;
|
|
@@ -168,31 +168,31 @@ export declare namespace EC {
|
|
|
168
168
|
/**
|
|
169
169
|
* Defines a structs array property.
|
|
170
170
|
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/structarrayproperty/
|
|
171
|
-
* @
|
|
171
|
+
* @public
|
|
172
172
|
*/
|
|
173
173
|
type StructArrayProperty = StructProperty & ArrayPropertyAttributes;
|
|
174
174
|
/**
|
|
175
175
|
* Defines an enumerations array property.
|
|
176
176
|
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/enumerationarrayproperty/
|
|
177
|
-
* @
|
|
177
|
+
* @public
|
|
178
178
|
*/
|
|
179
179
|
type EnumerationArrayProperty = EnumerationProperty & ArrayPropertyAttributes;
|
|
180
180
|
/**
|
|
181
181
|
* Defines a primitives array property.
|
|
182
182
|
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/primitivearrayproperty/
|
|
183
|
-
* @
|
|
183
|
+
* @public
|
|
184
184
|
*/
|
|
185
185
|
type PrimitiveArrayProperty = PrimitiveProperty & ArrayPropertyAttributes;
|
|
186
186
|
/**
|
|
187
187
|
* Defines an array property.
|
|
188
188
|
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/anyarrayproperty/
|
|
189
|
-
* @
|
|
189
|
+
* @public
|
|
190
190
|
*/
|
|
191
191
|
type ArrayProperty = StructArrayProperty | EnumerationArrayProperty | PrimitiveArrayProperty;
|
|
192
192
|
/**
|
|
193
193
|
* Defines a struct property.
|
|
194
194
|
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/structproperty/
|
|
195
|
-
* @
|
|
195
|
+
* @public
|
|
196
196
|
*/
|
|
197
197
|
interface StructProperty extends Property {
|
|
198
198
|
structClass: StructClass;
|
|
@@ -200,7 +200,7 @@ export declare namespace EC {
|
|
|
200
200
|
/**
|
|
201
201
|
* Defines an enumeration property.
|
|
202
202
|
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/enumerationproperty/
|
|
203
|
-
* @
|
|
203
|
+
* @public
|
|
204
204
|
*/
|
|
205
205
|
interface EnumerationProperty extends Property {
|
|
206
206
|
enumeration: Promise<Enumeration | undefined>;
|
|
@@ -209,7 +209,7 @@ export declare namespace EC {
|
|
|
209
209
|
/**
|
|
210
210
|
* Defines a navigation property.
|
|
211
211
|
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/navigationproperty/
|
|
212
|
-
* @
|
|
212
|
+
* @public
|
|
213
213
|
*/
|
|
214
214
|
interface NavigationProperty extends Property {
|
|
215
215
|
relationshipClass: Promise<RelationshipClass>;
|
|
@@ -218,13 +218,13 @@ export declare namespace EC {
|
|
|
218
218
|
/**
|
|
219
219
|
* Defines a primitive property type.
|
|
220
220
|
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/primitivetype/
|
|
221
|
-
* @
|
|
221
|
+
* @public
|
|
222
222
|
*/
|
|
223
223
|
type PrimitiveType = "Binary" | "Boolean" | "DateTime" | "Double" | "Integer" | "Long" | "Point2d" | "Point3d" | "String" | "IGeometry";
|
|
224
224
|
/**
|
|
225
225
|
* Defines a primitive property.
|
|
226
226
|
* @see https://www.itwinjs.org/reference/ecschema-metadata/metadata/primitiveproperty/
|
|
227
|
-
* @
|
|
227
|
+
* @public
|
|
228
228
|
*/
|
|
229
229
|
interface PrimitiveProperty extends Property {
|
|
230
230
|
primitiveType: PrimitiveType;
|
|
@@ -233,12 +233,12 @@ export declare namespace EC {
|
|
|
233
233
|
}
|
|
234
234
|
/**
|
|
235
235
|
* An identifiers' union of all supported primitive value types.
|
|
236
|
-
* @
|
|
236
|
+
* @public
|
|
237
237
|
*/
|
|
238
238
|
export type PrimitiveValueType = "Id" | Exclude<EC.PrimitiveType, "Binary" | "IGeometry">;
|
|
239
239
|
/**
|
|
240
240
|
* Describes a single step through an ECRelationship from source ECClass to target ECClass.
|
|
241
|
-
* @
|
|
241
|
+
* @public
|
|
242
242
|
*/
|
|
243
243
|
export interface RelationshipPathStep {
|
|
244
244
|
/** Full name of the source ECClass */
|
|
@@ -256,13 +256,13 @@ export interface RelationshipPathStep {
|
|
|
256
256
|
}
|
|
257
257
|
/**
|
|
258
258
|
* Describes a path from source ECClass to target ECClass through multiple ECRelationships.
|
|
259
|
-
* @
|
|
259
|
+
* @public
|
|
260
260
|
*/
|
|
261
261
|
export type RelationshipPath<TStep extends RelationshipPathStep = RelationshipPathStep> = TStep[];
|
|
262
262
|
/**
|
|
263
263
|
* Finds a class with the specified full class name using the given `ECSchemaProvider`.
|
|
264
264
|
* @throws Error if the schema or class is not found.
|
|
265
|
-
* @
|
|
265
|
+
* @public
|
|
266
266
|
*/
|
|
267
267
|
export declare function getClass(schemaProvider: ECSchemaProvider, fullClassName: string): Promise<EC.Class>;
|
|
268
268
|
//# sourceMappingURL=Metadata.d.ts.map
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { LRUMap } from "@itwin/core-bentley";
|
|
6
|
-
import { parseFullClassName } from "./Utils";
|
|
6
|
+
import { parseFullClassName } from "./Utils.js";
|
|
7
7
|
/**
|
|
8
8
|
* Creates a new `ECClassHierarchyInspector` that caches results of `derivesFrom` calls.
|
|
9
|
-
* @
|
|
9
|
+
* @public
|
|
10
10
|
*/
|
|
11
11
|
export function createCachingECClassHierarchyInspector(props) {
|
|
12
12
|
const map = new LRUMap(props.cacheSize ?? 0);
|
|
@@ -32,7 +32,7 @@ export function createCachingECClassHierarchyInspector(props) {
|
|
|
32
32
|
/**
|
|
33
33
|
* Finds a class with the specified full class name using the given `ECSchemaProvider`.
|
|
34
34
|
* @throws Error if the schema or class is not found.
|
|
35
|
-
* @
|
|
35
|
+
* @public
|
|
36
36
|
*/
|
|
37
37
|
export async function getClass(schemaProvider, fullClassName) {
|
|
38
38
|
const { schemaName, className } = parseFullClassName(fullClassName);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Metadata.js","sourceRoot":"","sources":["../../../src/shared/Metadata.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Metadata.js","sourceRoot":"","sources":["../../../src/shared/Metadata.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAqBhD;;;GAGG;AACH,MAAM,UAAU,sCAAsC,CAAC,KAKtD;IACC,MAAM,GAAG,GAAG,IAAI,MAAM,CAAqC,KAAK,CAAC,SAAS,IAAI,CAAC,CAAC,CAAC;IACjF,SAAS,cAAc,CAAC,gBAAwB,EAAE,aAAqB;QACrE,OAAO,GAAG,gBAAgB,IAAI,aAAa,EAAE,CAAC;IAChD,C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AC,WAAW,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,UAAU,SAAS,0BAA0B,UAAU,IAAI,CAAC,CAAC;IAC/E,CAAC;IACD,OAAO,WAAW,CAAC;AACrB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* An utility to parse schema and class names from full class name, where
|
|
3
3
|
* schema and class names are separated by either `:` or `.`.
|
|
4
|
-
* @
|
|
4
|
+
* @public
|
|
5
5
|
*/
|
|
6
6
|
export declare function parseFullClassName(fullClassName: string): {
|
|
7
7
|
schemaName: string;
|
|
@@ -10,24 +10,24 @@ export declare function parseFullClassName(fullClassName: string): {
|
|
|
10
10
|
/**
|
|
11
11
|
* An utility to normalize full class name from either `SchemaName:ClassName` or
|
|
12
12
|
* `SchemaName.ClassName` to always use the dot format.
|
|
13
|
-
* @
|
|
13
|
+
* @public
|
|
14
14
|
*/
|
|
15
15
|
export declare function normalizeFullClassName(fullClassName: string): string;
|
|
16
16
|
/**
|
|
17
17
|
* An utility to remove all extra whitespace from a given string.
|
|
18
|
-
* @
|
|
18
|
+
* @public
|
|
19
19
|
*/
|
|
20
20
|
export declare function trimWhitespace(str: string): string;
|
|
21
21
|
/**
|
|
22
22
|
* An utility to remove all extra whitespace from a given string.
|
|
23
|
-
* @
|
|
23
|
+
* @public
|
|
24
24
|
*/
|
|
25
25
|
export declare function trimWhitespace(str: string | undefined): string | undefined;
|
|
26
26
|
/**
|
|
27
27
|
* An utility that returns a promise that immediately resolves. Awaiting on the returned
|
|
28
28
|
* promise releases the main thread and allows other tasks to run.
|
|
29
29
|
*
|
|
30
|
-
* @
|
|
30
|
+
* @public
|
|
31
31
|
*/
|
|
32
32
|
export declare function releaseMainThread(): Promise<void>;
|
|
33
33
|
/**
|
|
@@ -44,7 +44,12 @@ export declare function releaseMainThread(): Promise<void>;
|
|
|
44
44
|
* ```
|
|
45
45
|
*
|
|
46
46
|
* @param releaseOnTimePassed The amount of time in milliseconds after which the main thread should be released. Defaults to `40` ms.
|
|
47
|
-
* @
|
|
47
|
+
* @public
|
|
48
48
|
*/
|
|
49
49
|
export declare function createMainThreadReleaseOnTimePassedHandler(releaseOnTimePassed?: number): () => Promise<void> | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* An utility to convert a julian day format to `Date`.
|
|
52
|
+
* @public
|
|
53
|
+
*/
|
|
54
|
+
export declare function julianToDateTime(julianDate: number): Date;
|
|
50
55
|
//# sourceMappingURL=Utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Utils.d.ts","sourceRoot":"","sources":["../../../src/shared/Utils.ts"],"names":[],"mappings":"AAOA;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,aAAa,EAAE,MAAM;;;EAIvD;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CASpE;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;AACpD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAAC;AAe5E;;;;;GAKG;AACH,wBAAsB,iBAAiB,kBAEtC;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,0CAA0C,CAAC,mBAAmB,SAAK,SAEtE,OAAO,CAAC,IAAI,CAAC,GAAG,SAAS,CASrC"}
|
|
1
|
+
{"version":3,"file":"Utils.d.ts","sourceRoot":"","sources":["../../../src/shared/Utils.ts"],"names":[],"mappings":"AAOA;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,aAAa,EAAE,MAAM;;;EAIvD;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CASpE;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;AACpD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAAC;AAe5E;;;;;GAKG;AACH,wBAAsB,iBAAiB,kBAEtC;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,0CAA0C,CAAC,mBAAmB,SAAK,SAEtE,OAAO,CAAC,IAAI,CAAC,GAAG,SAAS,CASrC;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAGzD"}
|
package/lib/esm/shared/Utils.js
CHANGED
|
@@ -6,7 +6,7 @@ import { assert } from "@itwin/core-bentley";
|
|
|
6
6
|
/**
|
|
7
7
|
* An utility to parse schema and class names from full class name, where
|
|
8
8
|
* schema and class names are separated by either `:` or `.`.
|
|
9
|
-
* @
|
|
9
|
+
* @public
|
|
10
10
|
*/
|
|
11
11
|
export function parseFullClassName(fullClassName) {
|
|
12
12
|
const [schemaName, className] = fullClassName.split(/[\.:]/);
|
|
@@ -16,7 +16,7 @@ export function parseFullClassName(fullClassName) {
|
|
|
16
16
|
/**
|
|
17
17
|
* An utility to normalize full class name from either `SchemaName:ClassName` or
|
|
18
18
|
* `SchemaName.ClassName` to always use the dot format.
|
|
19
|
-
* @
|
|
19
|
+
* @public
|
|
20
20
|
*/
|
|
21
21
|
export function normalizeFullClassName(fullClassName) {
|
|
22
22
|
const colonPos = fullClassName.indexOf(":");
|
|
@@ -28,9 +28,9 @@ export function normalizeFullClassName(fullClassName) {
|
|
|
28
28
|
const className = fullClassName.slice(colonPos + 1);
|
|
29
29
|
return `${schemaName}.${className}`;
|
|
30
30
|
}
|
|
31
|
-
/** @
|
|
31
|
+
/** @public */
|
|
32
32
|
export function trimWhitespace(str) {
|
|
33
|
-
|
|
33
|
+
/* c8 ignore next 3 */
|
|
34
34
|
if (!str) {
|
|
35
35
|
return str;
|
|
36
36
|
}
|
|
@@ -45,7 +45,7 @@ export function trimWhitespace(str) {
|
|
|
45
45
|
* An utility that returns a promise that immediately resolves. Awaiting on the returned
|
|
46
46
|
* promise releases the main thread and allows other tasks to run.
|
|
47
47
|
*
|
|
48
|
-
* @
|
|
48
|
+
* @public
|
|
49
49
|
*/
|
|
50
50
|
export async function releaseMainThread() {
|
|
51
51
|
return new Promise((resolve) => setTimeout(resolve, 0));
|
|
@@ -64,7 +64,7 @@ export async function releaseMainThread() {
|
|
|
64
64
|
* ```
|
|
65
65
|
*
|
|
66
66
|
* @param releaseOnTimePassed The amount of time in milliseconds after which the main thread should be released. Defaults to `40` ms.
|
|
67
|
-
* @
|
|
67
|
+
* @public
|
|
68
68
|
*/
|
|
69
69
|
export function createMainThreadReleaseOnTimePassedHandler(releaseOnTimePassed = 40) {
|
|
70
70
|
let start = Date.now();
|
|
@@ -78,4 +78,12 @@ export function createMainThreadReleaseOnTimePassedHandler(releaseOnTimePassed =
|
|
|
78
78
|
});
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
|
+
/**
|
|
82
|
+
* An utility to convert a julian day format to `Date`.
|
|
83
|
+
* @public
|
|
84
|
+
*/
|
|
85
|
+
export function julianToDateTime(julianDate) {
|
|
86
|
+
const millis = (julianDate - 2440587.5) * 86400000;
|
|
87
|
+
return new Date(millis);
|
|
88
|
+
}
|
|
81
89
|
//# sourceMappingURL=Utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Utils.js","sourceRoot":"","sources":["../../../src/shared/Utils.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,aAAqB;IACtD,MAAM,CAAC,UAAU,EAAE,SAAS,CAAC,GAAG,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC7D,MAAM,CAAC,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,SAAS,EAAE,yBAAyB,CAAC,CAAC;IAC/D,OAAO,EAAE,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iB,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE;YACnC,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACrB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,UAAkB;IACjD,MAAM,MAAM,GAAG,CAAC,UAAU,GAAG,SAAS,CAAC,GAAG,QAAQ,CAAC;IACnD,OAAO,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Id64String } from "@itwin/core-bentley";
|
|
2
|
-
import { PrimitiveValueType } from "./Metadata";
|
|
2
|
+
import { PrimitiveValueType } from "./Metadata.js";
|
|
3
3
|
/**
|
|
4
4
|
* A data structure uniquely identifying an ECInstance in an iModel.
|
|
5
|
-
* @
|
|
5
|
+
* @public
|
|
6
6
|
*/
|
|
7
7
|
export interface InstanceKey {
|
|
8
8
|
/** Full class name in format `SchemaName.ClassName` */
|
|
@@ -10,11 +10,11 @@ export interface InstanceKey {
|
|
|
10
10
|
/** ECInstance ID */
|
|
11
11
|
id: Id64String;
|
|
12
12
|
}
|
|
13
|
-
/** @
|
|
13
|
+
/** @public */
|
|
14
14
|
export declare namespace InstanceKey {
|
|
15
15
|
/**
|
|
16
16
|
* Checks whether the two given instance keys are equal.
|
|
17
|
-
* @
|
|
17
|
+
* @public
|
|
18
18
|
*/
|
|
19
19
|
function equals(lhs: InstanceKey, rhs: InstanceKey): boolean;
|
|
20
20
|
/**
|
|
@@ -28,7 +28,7 @@ export declare namespace InstanceKey {
|
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
30
|
* A data structure for a 2d point.
|
|
31
|
-
* @
|
|
31
|
+
* @public
|
|
32
32
|
*/
|
|
33
33
|
export interface Point2d {
|
|
34
34
|
x: number;
|
|
@@ -36,7 +36,7 @@ export interface Point2d {
|
|
|
36
36
|
}
|
|
37
37
|
/**
|
|
38
38
|
* A data structure for a 3d point.
|
|
39
|
-
* @
|
|
39
|
+
* @public
|
|
40
40
|
*/
|
|
41
41
|
export interface Point3d {
|
|
42
42
|
x: number;
|
|
@@ -45,27 +45,27 @@ export interface Point3d {
|
|
|
45
45
|
}
|
|
46
46
|
/**
|
|
47
47
|
* A union for all supported primitive value types.
|
|
48
|
-
* @
|
|
48
|
+
* @public
|
|
49
49
|
*/
|
|
50
50
|
export type PrimitiveValue = Id64String | string | number | boolean | Date | Point2d | Point3d;
|
|
51
|
-
/** @
|
|
51
|
+
/** @public */
|
|
52
52
|
export declare namespace PrimitiveValue {
|
|
53
53
|
/**
|
|
54
54
|
* Checks whether the given value is a `Point2d`.
|
|
55
55
|
* @note Since `Point3d` is a superset of `Point2d`, this function will return `true` for `Point3d` as well.
|
|
56
|
-
* @
|
|
56
|
+
* @public
|
|
57
57
|
*/
|
|
58
58
|
function isPoint2d(value: PrimitiveValue): value is Point2d;
|
|
59
59
|
/**
|
|
60
60
|
* Checks whether the given value is a `Point3d`.
|
|
61
|
-
* @
|
|
61
|
+
* @public
|
|
62
62
|
*/
|
|
63
63
|
function isPoint3d(value: PrimitiveValue): value is Point3d;
|
|
64
64
|
}
|
|
65
65
|
/**
|
|
66
66
|
* A type for a primitive value, its type and, optionally, its extended type.
|
|
67
67
|
* @note Use `TypedPrimitiveValue.create` to create an instance of this type.
|
|
68
|
-
* @
|
|
68
|
+
* @public
|
|
69
69
|
*/
|
|
70
70
|
export type TypedPrimitiveValue = ({
|
|
71
71
|
value: number;
|
|
@@ -95,12 +95,12 @@ export type TypedPrimitiveValue = ({
|
|
|
95
95
|
}) & {
|
|
96
96
|
extendedType?: string;
|
|
97
97
|
};
|
|
98
|
-
/** @
|
|
98
|
+
/** @public */
|
|
99
99
|
export declare namespace TypedPrimitiveValue {
|
|
100
100
|
/**
|
|
101
101
|
* A function for a creating a `TypedPrimitiveValue` object.
|
|
102
102
|
* @throws Error if primitive type and value are incompatible.
|
|
103
|
-
* @
|
|
103
|
+
* @public
|
|
104
104
|
*/
|
|
105
105
|
function create(value: PrimitiveValue, type: PrimitiveValueType, koqName?: string, extendedType?: string): TypedPrimitiveValue;
|
|
106
106
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Values.d.ts","sourceRoot":"","sources":["../../../src/shared/Values.ts"],"names":[],"mappings":"AAKA,OAAO,EAAwB,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Values.d.ts","sourceRoot":"","sources":["../../../src/shared/Values.ts"],"names":[],"mappings":"AAKA,OAAO,EAAwB,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,uDAAuD;IACvD,SAAS,EAAE,MAAM,CAAC;IAClB,oBAAoB;IACpB,EAAE,EAAE,UAAU,CAAC;CAChB;AAED,cAAc;AACd,yBAAiB,WAAW,CAAC;IAC3B;;;OAGG;IACH,SAAgB,MAAM,CAAC,GAAG,EAAE,WAAW,EAAE,GAAG,EAAE,WAAW,GAAG,OAAO,CAElE;IACD;;;;;;OAMG;IACH,SAAgB,OAAO,CAAC,GAAG,EAAE,WAAW,EAAE,GAAG,EAAE,WAAW,GAAG,MAAM,CAMlE;CACF;AAED;;;GAGG;AACH,MAAM,WAAW,OAAO;IACtB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED;;;GAGG;AACH,MAAM,WAAW,OAAO;IACtB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,OAAO,GAAG,OAAO,CAAC;AAE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* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { compareStrings, Id64 } from "@itwin/core-bentley";
|
|
6
|
-
/** @
|
|
6
|
+
/** @public */
|
|
7
7
|
export var InstanceKey;
|
|
8
8
|
(function (InstanceKey) {
|
|
9
9
|
/**
|
|
10
10
|
* Checks whether the two given instance keys are equal.
|
|
11
|
-
* @
|
|
11
|
+
* @public
|
|
12
12
|
*/
|
|
13
13
|
function equals(lhs, rhs) {
|
|
14
14
|
return lhs.className === rhs.className && lhs.id === rhs.id;
|
|
@@ -30,14 +30,14 @@ export var InstanceKey;
|
|
|
30
30
|
}
|
|
31
31
|
InstanceKey.compare = compare;
|
|
32
32
|
})(InstanceKey || (InstanceKey = {}));
|
|
33
|
-
/** @
|
|
33
|
+
/** @public */
|
|
34
34
|
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
35
35
|
export var PrimitiveValue;
|
|
36
36
|
(function (PrimitiveValue) {
|
|
37
37
|
/**
|
|
38
38
|
* Checks whether the given value is a `Point2d`.
|
|
39
39
|
* @note Since `Point3d` is a superset of `Point2d`, this function will return `true` for `Point3d` as well.
|
|
40
|
-
* @
|
|
40
|
+
* @public
|
|
41
41
|
*/
|
|
42
42
|
function isPoint2d(value) {
|
|
43
43
|
if (typeof value !== "object") {
|
|
@@ -49,7 +49,7 @@ export var PrimitiveValue;
|
|
|
49
49
|
PrimitiveValue.isPoint2d = isPoint2d;
|
|
50
50
|
/**
|
|
51
51
|
* Checks whether the given value is a `Point3d`.
|
|
52
|
-
* @
|
|
52
|
+
* @public
|
|
53
53
|
*/
|
|
54
54
|
function isPoint3d(value) {
|
|
55
55
|
if (typeof value !== "object") {
|
|
@@ -60,14 +60,14 @@ export var PrimitiveValue;
|
|
|
60
60
|
}
|
|
61
61
|
PrimitiveValue.isPoint3d = isPoint3d;
|
|
62
62
|
})(PrimitiveValue || (PrimitiveValue = {}));
|
|
63
|
-
/** @
|
|
63
|
+
/** @public */
|
|
64
64
|
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
65
65
|
export var TypedPrimitiveValue;
|
|
66
66
|
(function (TypedPrimitiveValue) {
|
|
67
67
|
/**
|
|
68
68
|
* A function for a creating a `TypedPrimitiveValue` object.
|
|
69
69
|
* @throws Error if primitive type and value are incompatible.
|
|
70
|
-
* @
|
|
70
|
+
* @public
|
|
71
71
|
*/
|
|
72
72
|
function create(value, type, koqName, extendedType) {
|
|
73
73
|
switch (type) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Values.js","sourceRoot":"","sources":["../../../src/shared/Values.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,cAAc,EAAE,IAAI,EAAc,MAAM,qBAAqB,CAAC;AAcvE,
|
|
1
|
+
{"version":3,"file":"Values.js","sourceRoot":"","sources":["../../../src/shared/Values.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,cAAc,EAAE,IAAI,EAAc,MAAM,qBAAqB,CAAC;AAcvE,cAAc;AACd,MAAM,KAAW,WAAW,CAsB3B;AAtBD,WAAiB,WAAW;IAC1B;;;OAGG;IACH,SAAgB,MAAM,CAAC,GAAgB,EAAE,GAAgB;QACvD,OAAO,GAAG,CAAC,SAAS,KAAK,GAAG,CAAC,SAAS,IAAI,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,EAAE,CAAC;IAC9D,CAAC;IAFe,kBAAM,SAErB,CAAA;IACD;;;;;;OAMG;IACH,SAAgB,OAAO,CAAC,GAAgB,EAAE,GAAgB;QACxD,MAAM,sBAAsB,GAAG,cAAc,CAAC,GAAG,CAAC,SAAS,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC;QAC5E,IAAI,sBAAsB,KAAK,CAAC,EAAE,CAAC;YACjC,OAAO,sBAAsB,CAAC;QAChC,CAAC;QACD,OAAO,cAAc,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,E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;QACD,MAAM,IAAI,KAAK,CAAC,sBAAsB,IAAI,gCAAgC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACrG,CAAC;IA9Ee,0BAAM,SA8ErB,CAAA;AACH,CAAC,EArFgB,mBAAmB,KAAnB,mBAAmB,QAqFnC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ECSchemaProvider, RelationshipPath, RelationshipPathStep } from "../Metadata";
|
|
1
|
+
import { ECSchemaProvider, RelationshipPath, RelationshipPathStep } from "../Metadata.js";
|
|
2
2
|
/**
|
|
3
3
|
* Describes a single JOIN step from source to target through a relationship.
|
|
4
|
-
* @
|
|
4
|
+
* @public
|
|
5
5
|
*/
|
|
6
6
|
interface JoinRelationshipPathStep extends RelationshipPathStep {
|
|
7
7
|
sourceAlias: string;
|
|
@@ -11,12 +11,12 @@ interface JoinRelationshipPathStep extends RelationshipPathStep {
|
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
13
|
* Describes a path of JOINs from source to target.
|
|
14
|
-
* @
|
|
14
|
+
* @public
|
|
15
15
|
*/
|
|
16
16
|
type JoinRelationshipPath = RelationshipPath<JoinRelationshipPathStep>;
|
|
17
17
|
/**
|
|
18
18
|
* Props for `createRelationshipPathJoinClause`.
|
|
19
|
-
* @
|
|
19
|
+
* @public
|
|
20
20
|
*/
|
|
21
21
|
interface CreateRelationshipPathJoinClauseProps {
|
|
22
22
|
schemaProvider: ECSchemaProvider;
|
|
@@ -44,7 +44,7 @@ interface CreateRelationshipPathJoinClauseProps {
|
|
|
44
44
|
* INNER JOIN [relationship_schema_name].[relationship_class_name] [relationship_alias] ON [relationship_alias].[SourceECInstanceId] = [source_alias].[ECInstanceId]
|
|
45
45
|
* INNER JOIN [target_schema_name].[target_class_name] [target_alias] ON [target_alias].[ECInstanceId] = [relationship_alias].[TargetECInstanceId]
|
|
46
46
|
* ```
|
|
47
|
-
* @
|
|
47
|
+
* @public
|
|
48
48
|
*/
|
|
49
49
|
export declare function createRelationshipPathJoinClause(props: CreateRelationshipPathJoinClauseProps): Promise<string>;
|
|
50
50
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ECSqlJoinSnippets.d.ts","sourceRoot":"","sources":["../../../../src/shared/ecsql-snippets/ECSqlJoinSnippets.ts"],"names":[],"mappings":"AAKA,OAAO,EAAM,gBAAgB,EAAY,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ECSqlJoinSnippets.d.ts","sourceRoot":"","sources":["../../../../src/shared/ecsql-snippets/ECSqlJoinSnippets.ts"],"names":[],"mappings":"AAKA,OAAO,EAAM,gBAAgB,EAAY,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAGxG;;;GAGG;AACH,UAAU,wBAAyB,SAAQ,oBAAoB;IAC7D,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;CAC9B;AAED;;;GAGG;AACH,KAAK,oBAAoB,GAAG,gBAAgB,CAAC,wBAAwB,CAAC,CAAC;AAEvE;;;GAGG;AACH,UAAU,qCAAqC;IAC7C,cAAc,EAAE,gBAAgB,CAAC;IACjC,IAAI,EAAE,oBAAoB,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,gCAAgC,CAAC,KAAK,EAAE,qCAAqC,mBAsElG"}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { getClass } from "../Metadata";
|
|
6
|
-
import { createRawPropertyValueSelector } from "./ECSqlValueSelectorSnippets";
|
|
5
|
+
import { getClass } from "../Metadata.js";
|
|
6
|
+
import { createRawPropertyValueSelector } from "./ECSqlValueSelectorSnippets.js";
|
|
7
7
|
/**
|
|
8
8
|
* Creates an ECSQL JOIN snippet for given relationships' path.
|
|
9
9
|
*
|
|
@@ -26,7 +26,7 @@ import { createRawPropertyValueSelector } from "./ECSqlValueSelectorSnippets";
|
|
|
26
26
|
* INNER JOIN [relationship_schema_name].[relationship_class_name] [relationship_alias] ON [relationship_alias].[SourceECInstanceId] = [source_alias].[ECInstanceId]
|
|
27
27
|
* INNER JOIN [target_schema_name].[target_class_name] [target_alias] ON [target_alias].[ECInstanceId] = [relationship_alias].[TargetECInstanceId]
|
|
28
28
|
* ```
|
|
29
|
-
* @
|
|
29
|
+
* @public
|
|
30
30
|
*/
|
|
31
31
|
export async function createRelationshipPathJoinClause(props) {
|
|
32
32
|
if (props.path.length === 0) {
|
|
@@ -113,13 +113,11 @@ async function getNavigationProperty(step) {
|
|
|
113
113
|
const source = !step.relationshipReverse ? step.source : step.target;
|
|
114
114
|
const target = !step.relationshipReverse ? step.target : step.source;
|
|
115
115
|
for (const prop of await source.getProperties()) {
|
|
116
|
-
// istanbul ignore else
|
|
117
116
|
if (prop.isNavigation() && prop.direction === "Forward" && (await prop.relationshipClass).fullName === step.relationship.fullName) {
|
|
118
117
|
return prop;
|
|
119
118
|
}
|
|
120
119
|
}
|
|
121
120
|
for (const prop of await target.getProperties()) {
|
|
122
|
-
// istanbul ignore else
|
|
123
121
|
if (prop.isNavigation() && prop.direction === "Backward" && (await prop.relationshipClass).fullName === step.relationship.fullName) {
|
|
124
122
|
return prop;
|
|
125
123
|
}
|