@itwin/ecschema-metadata 3.5.0-dev.66 → 3.5.0-dev.67
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/lib/cjs/Constants.d.ts +23 -23
- package/lib/cjs/Constants.js +33 -33
- package/lib/cjs/Constants.js.map +1 -1
- package/lib/cjs/Context.d.ts +139 -139
- package/lib/cjs/Context.js +204 -204
- package/lib/cjs/DelayedPromise.d.ts +88 -88
- package/lib/cjs/DelayedPromise.js +91 -91
- package/lib/cjs/DelayedPromise.js.map +1 -1
- package/lib/cjs/Deserialization/AbstractParser.d.ts +45 -45
- package/lib/cjs/Deserialization/AbstractParser.js +11 -11
- package/lib/cjs/Deserialization/AbstractParser.js.map +1 -1
- package/lib/cjs/Deserialization/Helper.d.ts +251 -251
- package/lib/cjs/Deserialization/Helper.js +843 -843
- package/lib/cjs/Deserialization/Helper.js.map +1 -1
- package/lib/cjs/Deserialization/JsonParser.d.ts +165 -165
- package/lib/cjs/Deserialization/JsonParser.js +680 -680
- package/lib/cjs/Deserialization/JsonParser.js.map +1 -1
- package/lib/cjs/Deserialization/JsonProps.d.ts +282 -282
- package/lib/cjs/Deserialization/JsonProps.js +9 -9
- package/lib/cjs/Deserialization/JsonProps.js.map +1 -1
- package/lib/cjs/Deserialization/SchemaGraphUtil.d.ts +34 -34
- package/lib/cjs/Deserialization/SchemaGraphUtil.js +77 -77
- package/lib/cjs/Deserialization/SchemaGraphUtil.js.map +1 -1
- package/lib/cjs/Deserialization/XmlParser.d.ts +85 -85
- package/lib/cjs/Deserialization/XmlParser.js +973 -973
- package/lib/cjs/Deserialization/XmlParser.js.map +1 -1
- package/lib/cjs/Deserialization/XmlSerializationUtils.d.ts +54 -54
- package/lib/cjs/Deserialization/XmlSerializationUtils.js +174 -174
- package/lib/cjs/Deserialization/XmlSerializationUtils.js.map +1 -1
- package/lib/cjs/ECName.d.ts +30 -30
- package/lib/cjs/ECName.js +85 -85
- package/lib/cjs/ECName.js.map +1 -1
- package/lib/cjs/ECObjects.d.ts +162 -162
- package/lib/cjs/ECObjects.js +453 -453
- package/lib/cjs/ECObjects.js.map +1 -1
- package/lib/cjs/Exception.d.ts +43 -43
- package/lib/cjs/Exception.js +86 -86
- package/lib/cjs/Exception.js.map +1 -1
- package/lib/cjs/Interfaces.d.ts +66 -66
- package/lib/cjs/Interfaces.js +9 -9
- package/lib/cjs/Interfaces.js.map +1 -1
- package/lib/cjs/Metadata/Class.d.ts +243 -243
- package/lib/cjs/Metadata/Class.js +558 -558
- package/lib/cjs/Metadata/Class.js.map +1 -1
- package/lib/cjs/Metadata/Constant.d.ts +64 -64
- package/lib/cjs/Metadata/Constant.js +123 -123
- package/lib/cjs/Metadata/Constant.js.map +1 -1
- package/lib/cjs/Metadata/CustomAttribute.d.ts +23 -23
- package/lib/cjs/Metadata/CustomAttribute.js +27 -27
- package/lib/cjs/Metadata/CustomAttribute.js.map +1 -1
- package/lib/cjs/Metadata/CustomAttributeClass.d.ts +39 -39
- package/lib/cjs/Metadata/CustomAttributeClass.js +68 -68
- package/lib/cjs/Metadata/CustomAttributeClass.js.map +1 -1
- package/lib/cjs/Metadata/EntityClass.d.ts +77 -77
- package/lib/cjs/Metadata/EntityClass.js +230 -230
- package/lib/cjs/Metadata/EntityClass.js.map +1 -1
- package/lib/cjs/Metadata/Enumeration.d.ts +86 -86
- package/lib/cjs/Metadata/Enumeration.js +159 -159
- package/lib/cjs/Metadata/Enumeration.js.map +1 -1
- package/lib/cjs/Metadata/Format.d.ts +98 -98
- package/lib/cjs/Metadata/Format.js +242 -242
- package/lib/cjs/Metadata/Format.js.map +1 -1
- package/lib/cjs/Metadata/InvertedUnit.d.ts +49 -49
- package/lib/cjs/Metadata/InvertedUnit.js +97 -97
- package/lib/cjs/Metadata/InvertedUnit.js.map +1 -1
- package/lib/cjs/Metadata/KindOfQuantity.d.ts +65 -65
- package/lib/cjs/Metadata/KindOfQuantity.js +225 -225
- package/lib/cjs/Metadata/KindOfQuantity.js.map +1 -1
- package/lib/cjs/Metadata/Mixin.d.ts +54 -54
- package/lib/cjs/Metadata/Mixin.js +113 -113
- package/lib/cjs/Metadata/Mixin.js.map +1 -1
- package/lib/cjs/Metadata/OverrideFormat.d.ts +55 -55
- package/lib/cjs/Metadata/OverrideFormat.js +88 -88
- package/lib/cjs/Metadata/OverrideFormat.js.map +1 -1
- package/lib/cjs/Metadata/Phenomenon.d.ts +33 -33
- package/lib/cjs/Metadata/Phenomenon.js +59 -59
- package/lib/cjs/Metadata/Phenomenon.js.map +1 -1
- package/lib/cjs/Metadata/Property.d.ts +197 -197
- package/lib/cjs/Metadata/Property.js +491 -491
- package/lib/cjs/Metadata/Property.js.map +1 -1
- package/lib/cjs/Metadata/PropertyCategory.d.ts +39 -39
- package/lib/cjs/Metadata/PropertyCategory.js +61 -61
- package/lib/cjs/Metadata/PropertyCategory.js.map +1 -1
- package/lib/cjs/Metadata/RelationshipClass.d.ts +152 -152
- package/lib/cjs/Metadata/RelationshipClass.js +349 -349
- package/lib/cjs/Metadata/RelationshipClass.js.map +1 -1
- package/lib/cjs/Metadata/Schema.d.ts +291 -291
- package/lib/cjs/Metadata/Schema.js +520 -520
- package/lib/cjs/Metadata/Schema.js.map +1 -1
- package/lib/cjs/Metadata/SchemaItem.d.ts +61 -61
- package/lib/cjs/Metadata/SchemaItem.js +136 -136
- package/lib/cjs/Metadata/SchemaItem.js.map +1 -1
- package/lib/cjs/Metadata/Unit.d.ts +76 -76
- package/lib/cjs/Metadata/Unit.js +162 -162
- package/lib/cjs/Metadata/UnitSystem.d.ts +20 -20
- package/lib/cjs/Metadata/UnitSystem.js +29 -29
- package/lib/cjs/Metadata/UnitSystem.js.map +1 -1
- package/lib/cjs/PropertyTypes.d.ts +49 -49
- package/lib/cjs/PropertyTypes.js +91 -91
- package/lib/cjs/PropertyTypes.js.map +1 -1
- package/lib/cjs/SchemaJsonLocater.d.ts +34 -34
- package/lib/cjs/SchemaJsonLocater.js +42 -42
- package/lib/cjs/SchemaJsonLocater.js.map +1 -1
- package/lib/cjs/SchemaKey.d.ts +110 -110
- package/lib/cjs/SchemaKey.js +219 -219
- package/lib/cjs/SchemaKey.js.map +1 -1
- package/lib/cjs/SchemaLoader.d.ts +23 -23
- package/lib/cjs/SchemaLoader.js +47 -47
- package/lib/cjs/SchemaLoader.js.map +1 -1
- package/lib/cjs/SchemaPartVisitorDelegate.d.ts +274 -274
- package/lib/cjs/SchemaPartVisitorDelegate.js +212 -212
- package/lib/cjs/SchemaPartVisitorDelegate.js.map +1 -1
- package/lib/cjs/UnitConversion/Graph.d.ts +34 -34
- package/lib/cjs/UnitConversion/Graph.js +83 -83
- package/lib/cjs/UnitConversion/Graph.js.map +1 -1
- package/lib/cjs/UnitConversion/Parser.d.ts +8 -8
- package/lib/cjs/UnitConversion/Parser.js +42 -42
- package/lib/cjs/UnitConversion/Parser.js.map +1 -1
- package/lib/cjs/UnitConversion/UnitConversion.d.ts +45 -45
- package/lib/cjs/UnitConversion/UnitConversion.js +77 -77
- package/lib/cjs/UnitConversion/UnitConversion.js.map +1 -1
- package/lib/cjs/UnitConversion/UnitConverter.d.ts +39 -39
- package/lib/cjs/UnitConversion/UnitConverter.js +116 -116
- package/lib/cjs/UnitConversion/UnitConverter.js.map +1 -1
- package/lib/cjs/UnitConversion/UnitTree.d.ts +43 -43
- package/lib/cjs/UnitConversion/UnitTree.js +169 -169
- package/lib/cjs/UnitConversion/UnitTree.js.map +1 -1
- package/lib/cjs/UnitProvider/SchemaUnitProvider.d.ts +77 -77
- package/lib/cjs/UnitProvider/SchemaUnitProvider.js +236 -236
- package/lib/cjs/UnitProvider/SchemaUnitProvider.js.map +1 -1
- package/lib/cjs/Validation/SchemaWalker.d.ts +23 -23
- package/lib/cjs/Validation/SchemaWalker.js +53 -53
- package/lib/cjs/Validation/SchemaWalker.js.map +1 -1
- package/lib/cjs/ecschema-metadata.d.ts +51 -51
- package/lib/cjs/ecschema-metadata.js +96 -96
- package/lib/cjs/ecschema-metadata.js.map +1 -1
- package/lib/cjs/utils/SchemaGraph.d.ts +25 -25
- package/lib/cjs/utils/SchemaGraph.js +65 -65
- package/lib/cjs/utils/SchemaGraph.js.map +1 -1
- package/package.json +7 -7
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { Schema } from "../Metadata/Schema";
|
|
2
|
-
/**
|
|
3
|
-
* Utility class for working with Schema graphs.
|
|
4
|
-
* @internal
|
|
5
|
-
*/
|
|
6
|
-
export declare class SchemaGraphUtil {
|
|
7
|
-
/**
|
|
8
|
-
* Creates a flattened list of schemas in topological order, typically used before schema import
|
|
9
|
-
* so that dependent schemas are processed after their references.
|
|
10
|
-
* @param insertSchema The schema to be imported.
|
|
11
|
-
* @param schemas The schema collection that will hold the ordered schemas. If null, the collection
|
|
12
|
-
* will be created internally and passed along during recursive calls.
|
|
13
|
-
*/
|
|
14
|
-
static buildDependencyOrderedSchemaList(insertSchema: Schema, schemas?: Schema[]): Schema[];
|
|
15
|
-
/**
|
|
16
|
-
* Indicates if the given Schema references the possibleDependency Schema.
|
|
17
|
-
* @param schema The possible dependent schema.
|
|
18
|
-
* @param possibleDependency The possible Schema dependency.
|
|
19
|
-
*/
|
|
20
|
-
private static dependsOn;
|
|
21
|
-
/**
|
|
22
|
-
* Indicates if the given Schema directly references the possiblyReferencedSchema Schema.
|
|
23
|
-
* @param schema The possible parent schema.
|
|
24
|
-
* @param possibleDependency The Schema that may be referenced.
|
|
25
|
-
*/
|
|
26
|
-
private static directlyReferences;
|
|
27
|
-
/**
|
|
28
|
-
* Helper method that manages the insertion of a Schema into the schemas collection
|
|
29
|
-
* based on the topological ordering algorithm.
|
|
30
|
-
* @param schemas The ordered Schema collection.
|
|
31
|
-
* @param insertSchema The Schema to insert.
|
|
32
|
-
*/
|
|
33
|
-
private static insertSchemaInDependencyOrderedList;
|
|
34
|
-
}
|
|
1
|
+
import { Schema } from "../Metadata/Schema";
|
|
2
|
+
/**
|
|
3
|
+
* Utility class for working with Schema graphs.
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export declare class SchemaGraphUtil {
|
|
7
|
+
/**
|
|
8
|
+
* Creates a flattened list of schemas in topological order, typically used before schema import
|
|
9
|
+
* so that dependent schemas are processed after their references.
|
|
10
|
+
* @param insertSchema The schema to be imported.
|
|
11
|
+
* @param schemas The schema collection that will hold the ordered schemas. If null, the collection
|
|
12
|
+
* will be created internally and passed along during recursive calls.
|
|
13
|
+
*/
|
|
14
|
+
static buildDependencyOrderedSchemaList(insertSchema: Schema, schemas?: Schema[]): Schema[];
|
|
15
|
+
/**
|
|
16
|
+
* Indicates if the given Schema references the possibleDependency Schema.
|
|
17
|
+
* @param schema The possible dependent schema.
|
|
18
|
+
* @param possibleDependency The possible Schema dependency.
|
|
19
|
+
*/
|
|
20
|
+
private static dependsOn;
|
|
21
|
+
/**
|
|
22
|
+
* Indicates if the given Schema directly references the possiblyReferencedSchema Schema.
|
|
23
|
+
* @param schema The possible parent schema.
|
|
24
|
+
* @param possibleDependency The Schema that may be referenced.
|
|
25
|
+
*/
|
|
26
|
+
private static directlyReferences;
|
|
27
|
+
/**
|
|
28
|
+
* Helper method that manages the insertion of a Schema into the schemas collection
|
|
29
|
+
* based on the topological ordering algorithm.
|
|
30
|
+
* @param schemas The ordered Schema collection.
|
|
31
|
+
* @param insertSchema The Schema to insert.
|
|
32
|
+
*/
|
|
33
|
+
private static insertSchemaInDependencyOrderedList;
|
|
34
|
+
}
|
|
35
35
|
//# sourceMappingURL=SchemaGraphUtil.d.ts.map
|
|
@@ -1,78 +1,78 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*---------------------------------------------------------------------------------------------
|
|
3
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
-
*--------------------------------------------------------------------------------------------*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.SchemaGraphUtil = void 0;
|
|
8
|
-
/**
|
|
9
|
-
* Utility class for working with Schema graphs.
|
|
10
|
-
* @internal
|
|
11
|
-
*/
|
|
12
|
-
class SchemaGraphUtil {
|
|
13
|
-
/**
|
|
14
|
-
* Creates a flattened list of schemas in topological order, typically used before schema import
|
|
15
|
-
* so that dependent schemas are processed after their references.
|
|
16
|
-
* @param insertSchema The schema to be imported.
|
|
17
|
-
* @param schemas The schema collection that will hold the ordered schemas. If null, the collection
|
|
18
|
-
* will be created internally and passed along during recursive calls.
|
|
19
|
-
*/
|
|
20
|
-
static buildDependencyOrderedSchemaList(insertSchema, schemas) {
|
|
21
|
-
if (!schemas)
|
|
22
|
-
schemas = [];
|
|
23
|
-
this.insertSchemaInDependencyOrderedList(schemas, insertSchema);
|
|
24
|
-
for (const reference of insertSchema.references) {
|
|
25
|
-
this.buildDependencyOrderedSchemaList(reference, schemas);
|
|
26
|
-
}
|
|
27
|
-
return schemas;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Indicates if the given Schema references the possibleDependency Schema.
|
|
31
|
-
* @param schema The possible dependent schema.
|
|
32
|
-
* @param possibleDependency The possible Schema dependency.
|
|
33
|
-
*/
|
|
34
|
-
static dependsOn(schema, possibleDependency) {
|
|
35
|
-
if (this.directlyReferences(schema, possibleDependency))
|
|
36
|
-
return true;
|
|
37
|
-
// search for dependencies in indirect references
|
|
38
|
-
for (const reference of schema.references) {
|
|
39
|
-
if (this.dependsOn(reference, possibleDependency))
|
|
40
|
-
return true;
|
|
41
|
-
}
|
|
42
|
-
return false;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Indicates if the given Schema directly references the possiblyReferencedSchema Schema.
|
|
46
|
-
* @param schema The possible parent schema.
|
|
47
|
-
* @param possibleDependency The Schema that may be referenced.
|
|
48
|
-
*/
|
|
49
|
-
static directlyReferences(schema, possiblyReferencedSchema) {
|
|
50
|
-
for (const reference of schema.references) {
|
|
51
|
-
if (reference === possiblyReferencedSchema)
|
|
52
|
-
return true;
|
|
53
|
-
}
|
|
54
|
-
return false;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Helper method that manages the insertion of a Schema into the schemas collection
|
|
58
|
-
* based on the topological ordering algorithm.
|
|
59
|
-
* @param schemas The ordered Schema collection.
|
|
60
|
-
* @param insertSchema The Schema to insert.
|
|
61
|
-
*/
|
|
62
|
-
static insertSchemaInDependencyOrderedList(schemas, insertSchema) {
|
|
63
|
-
if (schemas.includes(insertSchema))
|
|
64
|
-
return;
|
|
65
|
-
for (let i = schemas.length - 1; i >= 0; --i) {
|
|
66
|
-
const schema = schemas[i];
|
|
67
|
-
if (this.dependsOn(insertSchema, schema)) {
|
|
68
|
-
// insert right after the referenced schema in the list
|
|
69
|
-
const index = schemas.indexOf(schema);
|
|
70
|
-
schemas.splice(index + 1, 0, insertSchema);
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
schemas.splice(0, 0, insertSchema);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
exports.SchemaGraphUtil = SchemaGraphUtil;
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.SchemaGraphUtil = void 0;
|
|
8
|
+
/**
|
|
9
|
+
* Utility class for working with Schema graphs.
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
class SchemaGraphUtil {
|
|
13
|
+
/**
|
|
14
|
+
* Creates a flattened list of schemas in topological order, typically used before schema import
|
|
15
|
+
* so that dependent schemas are processed after their references.
|
|
16
|
+
* @param insertSchema The schema to be imported.
|
|
17
|
+
* @param schemas The schema collection that will hold the ordered schemas. If null, the collection
|
|
18
|
+
* will be created internally and passed along during recursive calls.
|
|
19
|
+
*/
|
|
20
|
+
static buildDependencyOrderedSchemaList(insertSchema, schemas) {
|
|
21
|
+
if (!schemas)
|
|
22
|
+
schemas = [];
|
|
23
|
+
this.insertSchemaInDependencyOrderedList(schemas, insertSchema);
|
|
24
|
+
for (const reference of insertSchema.references) {
|
|
25
|
+
this.buildDependencyOrderedSchemaList(reference, schemas);
|
|
26
|
+
}
|
|
27
|
+
return schemas;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Indicates if the given Schema references the possibleDependency Schema.
|
|
31
|
+
* @param schema The possible dependent schema.
|
|
32
|
+
* @param possibleDependency The possible Schema dependency.
|
|
33
|
+
*/
|
|
34
|
+
static dependsOn(schema, possibleDependency) {
|
|
35
|
+
if (this.directlyReferences(schema, possibleDependency))
|
|
36
|
+
return true;
|
|
37
|
+
// search for dependencies in indirect references
|
|
38
|
+
for (const reference of schema.references) {
|
|
39
|
+
if (this.dependsOn(reference, possibleDependency))
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Indicates if the given Schema directly references the possiblyReferencedSchema Schema.
|
|
46
|
+
* @param schema The possible parent schema.
|
|
47
|
+
* @param possibleDependency The Schema that may be referenced.
|
|
48
|
+
*/
|
|
49
|
+
static directlyReferences(schema, possiblyReferencedSchema) {
|
|
50
|
+
for (const reference of schema.references) {
|
|
51
|
+
if (reference === possiblyReferencedSchema)
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Helper method that manages the insertion of a Schema into the schemas collection
|
|
58
|
+
* based on the topological ordering algorithm.
|
|
59
|
+
* @param schemas The ordered Schema collection.
|
|
60
|
+
* @param insertSchema The Schema to insert.
|
|
61
|
+
*/
|
|
62
|
+
static insertSchemaInDependencyOrderedList(schemas, insertSchema) {
|
|
63
|
+
if (schemas.includes(insertSchema))
|
|
64
|
+
return;
|
|
65
|
+
for (let i = schemas.length - 1; i >= 0; --i) {
|
|
66
|
+
const schema = schemas[i];
|
|
67
|
+
if (this.dependsOn(insertSchema, schema)) {
|
|
68
|
+
// insert right after the referenced schema in the list
|
|
69
|
+
const index = schemas.indexOf(schema);
|
|
70
|
+
schemas.splice(index + 1, 0, insertSchema);
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
schemas.splice(0, 0, insertSchema);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
exports.SchemaGraphUtil = SchemaGraphUtil;
|
|
78
78
|
//# sourceMappingURL=SchemaGraphUtil.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaGraphUtil.js","sourceRoot":"","sources":["../../../src/Deserialization/SchemaGraphUtil.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAI/F;;;GAGG;AACH,MAAa,eAAe;IAC1B;;;;;;OAMG;IACI,MAAM,CAAC,gCAAgC,CAAC,YAAoB,EAAE,OAAkB;QACrF,IAAI,CAAC,OAAO;YACV,OAAO,GAAG,EAAE,CAAC;QAEf,IAAI,CAAC,mCAAmC,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;QAChE,KAAK,MAAM,SAAS,IAAI,YAAY,CAAC,UAAU,EAAE;YAC/C,IAAI,CAAC,gCAAgC,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;SAC3D;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IAED;;;;OAIG;IACK,MAAM,CAAC,SAAS,CAAC,MAAc,EAAE,kBAA0B;QACjE,IAAI,IAAI,CAAC,kBAAkB,CAAC,MAAM,EAAE,kBAAkB,CAAC;YACrD,OAAO,IAAI,CAAC;QAEd,iDAAiD;QACjD,KAAK,MAAM,SAAS,IAAI,MAAM,CAAC,UAAU,EAAE;YACzC,IAAI,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,kBAAkB,CAAC;gBAC/C,OAAO,IAAI,CAAC;SACf;QAED,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;;OAIG;IACK,MAAM,CAAC,kBAAkB,CAAC,MAAc,EAAE,wBAAgC;QAChF,KAAK,MAAM,SAAS,IAAI,MAAM,CAAC,UAAU,EAAE;YACzC,IAAI,SAAS,KAAK,wBAAwB;gBACxC,OAAO,IAAI,CAAC;SACf;QAED,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;;;OAKG;IACK,MAAM,CAAC,mCAAmC,CAAC,OAAiB,EAAE,YAAoB;QACxF,IAAI,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC;YAChC,OAAO;QAET,KAAK,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,EAAE;YAC5C,MAAM,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;YAC1B,IAAI,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,MAAM,CAAC,EAAE;gBACxC,uDAAuD;gBACvD,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;gBACtC,OAAO,CAAC,MAAM,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC,EAAE,YAAY,CAAC,CAAC;gBAC3C,OAAO;aACR;SACF;QAED,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,YAAY,CAAC,CAAC;IACrC,CAAC;CACF;AAzED,0CAyEC","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\nimport { Schema } from \"../Metadata/Schema\";\n\n/**\n * Utility class for working with Schema graphs.\n * @internal\n */\nexport class SchemaGraphUtil {\n /**\n * Creates a flattened list of schemas in topological order, typically used before schema import\n * so that dependent schemas are processed after their references.\n * @param insertSchema The schema to be imported.\n * @param schemas The schema collection that will hold the ordered schemas. If null, the collection\n * will be created internally and passed along during recursive calls.\n */\n public static buildDependencyOrderedSchemaList(insertSchema: Schema, schemas?: Schema[]): Schema[] {\n if (!schemas)\n schemas = [];\n\n this.insertSchemaInDependencyOrderedList(schemas, insertSchema);\n for (const reference of insertSchema.references) {\n this.buildDependencyOrderedSchemaList(reference, schemas);\n }\n return schemas;\n }\n\n /**\n * Indicates if the given Schema references the possibleDependency Schema.\n * @param schema The possible dependent schema.\n * @param possibleDependency The possible Schema dependency.\n */\n private static dependsOn(schema: Schema, possibleDependency: Schema): boolean {\n if (this.directlyReferences(schema, possibleDependency))\n return true;\n\n // search for dependencies in indirect references\n for (const reference of schema.references) {\n if (this.dependsOn(reference, possibleDependency))\n return true;\n }\n\n return false;\n }\n\n /**\n * Indicates if the given Schema directly references the possiblyReferencedSchema Schema.\n * @param schema The possible parent schema.\n * @param possibleDependency The Schema that may be referenced.\n */\n private static directlyReferences(schema: Schema, possiblyReferencedSchema: Schema): boolean {\n for (const reference of schema.references) {\n if (reference === possiblyReferencedSchema)\n return true;\n }\n\n return false;\n }\n\n /**\n * Helper method that manages the insertion of a Schema into the schemas collection\n * based on the topological ordering algorithm.\n * @param schemas The ordered Schema collection.\n * @param insertSchema The Schema to insert.\n */\n private static insertSchemaInDependencyOrderedList(schemas: Schema[], insertSchema: Schema) {\n if (schemas.includes(insertSchema))\n return;\n\n for (let i = schemas.length - 1; i >= 0; --i) {\n const schema = schemas[i];\n if (this.dependsOn(insertSchema, schema)) {\n // insert right after the referenced schema in the list\n const index = schemas.indexOf(schema);\n schemas.splice(index + 1, 0, insertSchema);\n return;\n }\n }\n\n schemas.splice(0, 0, insertSchema);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"SchemaGraphUtil.js","sourceRoot":"","sources":["../../../src/Deserialization/SchemaGraphUtil.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAI/F;;;GAGG;AACH,MAAa,eAAe;IAC1B;;;;;;OAMG;IACI,MAAM,CAAC,gCAAgC,CAAC,YAAoB,EAAE,OAAkB;QACrF,IAAI,CAAC,OAAO;YACV,OAAO,GAAG,EAAE,CAAC;QAEf,IAAI,CAAC,mCAAmC,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;QAChE,KAAK,MAAM,SAAS,IAAI,YAAY,CAAC,UAAU,EAAE;YAC/C,IAAI,CAAC,gCAAgC,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;SAC3D;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IAED;;;;OAIG;IACK,MAAM,CAAC,SAAS,CAAC,MAAc,EAAE,kBAA0B;QACjE,IAAI,IAAI,CAAC,kBAAkB,CAAC,MAAM,EAAE,kBAAkB,CAAC;YACrD,OAAO,IAAI,CAAC;QAEd,iDAAiD;QACjD,KAAK,MAAM,SAAS,IAAI,MAAM,CAAC,UAAU,EAAE;YACzC,IAAI,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,kBAAkB,CAAC;gBAC/C,OAAO,IAAI,CAAC;SACf;QAED,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;;OAIG;IACK,MAAM,CAAC,kBAAkB,CAAC,MAAc,EAAE,wBAAgC;QAChF,KAAK,MAAM,SAAS,IAAI,MAAM,CAAC,UAAU,EAAE;YACzC,IAAI,SAAS,KAAK,wBAAwB;gBACxC,OAAO,IAAI,CAAC;SACf;QAED,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;;;OAKG;IACK,MAAM,CAAC,mCAAmC,CAAC,OAAiB,EAAE,YAAoB;QACxF,IAAI,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC;YAChC,OAAO;QAET,KAAK,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,EAAE;YAC5C,MAAM,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;YAC1B,IAAI,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,MAAM,CAAC,EAAE;gBACxC,uDAAuD;gBACvD,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;gBACtC,OAAO,CAAC,MAAM,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC,EAAE,YAAY,CAAC,CAAC;gBAC3C,OAAO;aACR;SACF;QAED,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,YAAY,CAAC,CAAC;IACrC,CAAC;CACF;AAzED,0CAyEC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nimport { Schema } from \"../Metadata/Schema\";\r\n\r\n/**\r\n * Utility class for working with Schema graphs.\r\n * @internal\r\n */\r\nexport class SchemaGraphUtil {\r\n /**\r\n * Creates a flattened list of schemas in topological order, typically used before schema import\r\n * so that dependent schemas are processed after their references.\r\n * @param insertSchema The schema to be imported.\r\n * @param schemas The schema collection that will hold the ordered schemas. If null, the collection\r\n * will be created internally and passed along during recursive calls.\r\n */\r\n public static buildDependencyOrderedSchemaList(insertSchema: Schema, schemas?: Schema[]): Schema[] {\r\n if (!schemas)\r\n schemas = [];\r\n\r\n this.insertSchemaInDependencyOrderedList(schemas, insertSchema);\r\n for (const reference of insertSchema.references) {\r\n this.buildDependencyOrderedSchemaList(reference, schemas);\r\n }\r\n return schemas;\r\n }\r\n\r\n /**\r\n * Indicates if the given Schema references the possibleDependency Schema.\r\n * @param schema The possible dependent schema.\r\n * @param possibleDependency The possible Schema dependency.\r\n */\r\n private static dependsOn(schema: Schema, possibleDependency: Schema): boolean {\r\n if (this.directlyReferences(schema, possibleDependency))\r\n return true;\r\n\r\n // search for dependencies in indirect references\r\n for (const reference of schema.references) {\r\n if (this.dependsOn(reference, possibleDependency))\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Indicates if the given Schema directly references the possiblyReferencedSchema Schema.\r\n * @param schema The possible parent schema.\r\n * @param possibleDependency The Schema that may be referenced.\r\n */\r\n private static directlyReferences(schema: Schema, possiblyReferencedSchema: Schema): boolean {\r\n for (const reference of schema.references) {\r\n if (reference === possiblyReferencedSchema)\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Helper method that manages the insertion of a Schema into the schemas collection\r\n * based on the topological ordering algorithm.\r\n * @param schemas The ordered Schema collection.\r\n * @param insertSchema The Schema to insert.\r\n */\r\n private static insertSchemaInDependencyOrderedList(schemas: Schema[], insertSchema: Schema) {\r\n if (schemas.includes(insertSchema))\r\n return;\r\n\r\n for (let i = schemas.length - 1; i >= 0; --i) {\r\n const schema = schemas[i];\r\n if (this.dependsOn(insertSchema, schema)) {\r\n // insert right after the referenced schema in the list\r\n const index = schemas.indexOf(schema);\r\n schemas.splice(index + 1, 0, insertSchema);\r\n return;\r\n }\r\n }\r\n\r\n schemas.splice(0, 0, insertSchema);\r\n }\r\n}\r\n"]}
|
|
@@ -1,86 +1,86 @@
|
|
|
1
|
-
import { AbstractParser, CAProviderTuple } from "./AbstractParser";
|
|
2
|
-
import { ConstantProps, CustomAttributeClassProps, EntityClassProps, EnumerationProps, FormatProps, InvertedUnitProps, KindOfQuantityProps, MixinProps, NavigationPropertyProps, PhenomenonProps, PrimitiveArrayPropertyProps, PrimitivePropertyProps, PropertyCategoryProps, RelationshipClassProps, SchemaProps, SchemaReferenceProps, StructArrayPropertyProps, StructClassProps, StructPropertyProps, UnitProps, UnitSystemProps } from "./JsonProps";
|
|
3
|
-
/** @internal */
|
|
4
|
-
export declare class XmlParser extends AbstractParser<Element> {
|
|
5
|
-
private _rawSchema;
|
|
6
|
-
private _schemaName?;
|
|
7
|
-
private _schemaReferenceNames;
|
|
8
|
-
private _schemaAlias;
|
|
9
|
-
private _schemaVersion?;
|
|
10
|
-
private _xmlNamespace?;
|
|
11
|
-
private _ecXmlVersion?;
|
|
12
|
-
private _currentItemFullName?;
|
|
13
|
-
private _schemaItems;
|
|
14
|
-
private _mapIsPopulated;
|
|
15
|
-
constructor(rawSchema: Readonly<Document>);
|
|
16
|
-
parseSchema(): SchemaProps;
|
|
17
|
-
getReferences(): Iterable<SchemaReferenceProps>;
|
|
18
|
-
getItems(): Iterable<[string, string, Element]>;
|
|
19
|
-
findItem(itemName: string): [string, string, Element] | undefined;
|
|
20
|
-
parseEntityClass(xmlElement: Element): EntityClassProps;
|
|
21
|
-
parseMixin(xmlElement: Element): MixinProps;
|
|
22
|
-
parseStructClass(xmlElement: Element): StructClassProps;
|
|
23
|
-
parseCustomAttributeClass(xmlElement: Element): CustomAttributeClassProps;
|
|
24
|
-
parseRelationshipClass(xmlElement: Element): RelationshipClassProps;
|
|
25
|
-
parseEnumeration(xmlElement: Element): EnumerationProps;
|
|
26
|
-
parseKindOfQuantity(xmlElement: Element): KindOfQuantityProps;
|
|
27
|
-
parsePropertyCategory(xmlElement: Element): PropertyCategoryProps;
|
|
28
|
-
parseUnit(xmlElement: Element): UnitProps;
|
|
29
|
-
parseInvertedUnit(xmlElement: Element): InvertedUnitProps;
|
|
30
|
-
parseConstant(xmlElement: Element): ConstantProps;
|
|
31
|
-
parsePhenomenon(xmlElement: Element): PhenomenonProps;
|
|
32
|
-
parseFormat(xmlElement: Element): FormatProps;
|
|
33
|
-
parseUnitSystem(xmlElement: Element): UnitSystemProps;
|
|
34
|
-
getProperties(xmlElement: Element, itemName: string): Iterable<[string, string, Element]>;
|
|
35
|
-
parsePrimitiveProperty(xmlElement: Element): PrimitivePropertyProps;
|
|
36
|
-
parseStructProperty(xmlElement: Element): StructPropertyProps;
|
|
37
|
-
parsePrimitiveArrayProperty(xmlElement: Element): PrimitiveArrayPropertyProps;
|
|
38
|
-
parseStructArrayProperty(xmlElement: Element): StructArrayPropertyProps;
|
|
39
|
-
parseNavigationProperty(xmlElement: Element): NavigationPropertyProps;
|
|
40
|
-
getSchemaCustomAttributeProviders(): Iterable<CAProviderTuple>;
|
|
41
|
-
getClassCustomAttributeProviders(xmlElement: Element): Iterable<CAProviderTuple>;
|
|
42
|
-
getPropertyCustomAttributeProviders(xmlElement: Element): Iterable<CAProviderTuple>;
|
|
43
|
-
getRelationshipConstraintCustomAttributeProviders(xmlElement: Element): [Iterable<CAProviderTuple>, Iterable<CAProviderTuple>];
|
|
44
|
-
private getElementChildren;
|
|
45
|
-
private getElementChildrenByTagName;
|
|
46
|
-
private getOptionalAttribute;
|
|
47
|
-
private getOptionalFloatAttribute;
|
|
48
|
-
private getOptionalIntAttribute;
|
|
49
|
-
private parseBoolean;
|
|
50
|
-
private getRequiredAttribute;
|
|
51
|
-
private getSchemaReference;
|
|
52
|
-
private getSchemaItemType;
|
|
53
|
-
private getSchemaChildren;
|
|
54
|
-
private getSchemaItemProps;
|
|
55
|
-
private getClassProps;
|
|
56
|
-
private getRelationshipConstraintProps;
|
|
57
|
-
private getPropertyType;
|
|
58
|
-
private getPropertyName;
|
|
59
|
-
private getPropertyProps;
|
|
60
|
-
private getPropertyTypeName;
|
|
61
|
-
private getPrimitiveOrEnumPropertyBaseProps;
|
|
62
|
-
private getPropertyMinAndMaxOccurs;
|
|
63
|
-
private getCustomAttributeProviders;
|
|
64
|
-
private getCustomAttributeProvider;
|
|
65
|
-
private addCAPropertyValues;
|
|
66
|
-
private readPropertyValue;
|
|
67
|
-
private readArrayPropertyValue;
|
|
68
|
-
private readPrimitiveArrayValues;
|
|
69
|
-
private readStructArrayValues;
|
|
70
|
-
private readStructPropertyValue;
|
|
71
|
-
private readPrimitivePropertyValue;
|
|
72
|
-
private getBooleanPropertyValue;
|
|
73
|
-
private getIntegerPropertyValue;
|
|
74
|
-
private getDatePropertyValue;
|
|
75
|
-
private getDoublePropertyValue;
|
|
76
|
-
private getPoint2DPropertyValue;
|
|
77
|
-
private getPoint3DPropertyValue;
|
|
78
|
-
private isSchemaFullNameValidForVersion;
|
|
79
|
-
private parseXmlNamespace;
|
|
80
|
-
private getQualifiedTypeName;
|
|
81
|
-
/** The rest of the API uses the full name format of `{SchemaName}.{SchemaItemName}`,
|
|
82
|
-
* meaning all of the references in the format string need to be changed.
|
|
83
|
-
*/
|
|
84
|
-
private getQualifiedPresentationUnits;
|
|
85
|
-
}
|
|
1
|
+
import { AbstractParser, CAProviderTuple } from "./AbstractParser";
|
|
2
|
+
import { ConstantProps, CustomAttributeClassProps, EntityClassProps, EnumerationProps, FormatProps, InvertedUnitProps, KindOfQuantityProps, MixinProps, NavigationPropertyProps, PhenomenonProps, PrimitiveArrayPropertyProps, PrimitivePropertyProps, PropertyCategoryProps, RelationshipClassProps, SchemaProps, SchemaReferenceProps, StructArrayPropertyProps, StructClassProps, StructPropertyProps, UnitProps, UnitSystemProps } from "./JsonProps";
|
|
3
|
+
/** @internal */
|
|
4
|
+
export declare class XmlParser extends AbstractParser<Element> {
|
|
5
|
+
private _rawSchema;
|
|
6
|
+
private _schemaName?;
|
|
7
|
+
private _schemaReferenceNames;
|
|
8
|
+
private _schemaAlias;
|
|
9
|
+
private _schemaVersion?;
|
|
10
|
+
private _xmlNamespace?;
|
|
11
|
+
private _ecXmlVersion?;
|
|
12
|
+
private _currentItemFullName?;
|
|
13
|
+
private _schemaItems;
|
|
14
|
+
private _mapIsPopulated;
|
|
15
|
+
constructor(rawSchema: Readonly<Document>);
|
|
16
|
+
parseSchema(): SchemaProps;
|
|
17
|
+
getReferences(): Iterable<SchemaReferenceProps>;
|
|
18
|
+
getItems(): Iterable<[string, string, Element]>;
|
|
19
|
+
findItem(itemName: string): [string, string, Element] | undefined;
|
|
20
|
+
parseEntityClass(xmlElement: Element): EntityClassProps;
|
|
21
|
+
parseMixin(xmlElement: Element): MixinProps;
|
|
22
|
+
parseStructClass(xmlElement: Element): StructClassProps;
|
|
23
|
+
parseCustomAttributeClass(xmlElement: Element): CustomAttributeClassProps;
|
|
24
|
+
parseRelationshipClass(xmlElement: Element): RelationshipClassProps;
|
|
25
|
+
parseEnumeration(xmlElement: Element): EnumerationProps;
|
|
26
|
+
parseKindOfQuantity(xmlElement: Element): KindOfQuantityProps;
|
|
27
|
+
parsePropertyCategory(xmlElement: Element): PropertyCategoryProps;
|
|
28
|
+
parseUnit(xmlElement: Element): UnitProps;
|
|
29
|
+
parseInvertedUnit(xmlElement: Element): InvertedUnitProps;
|
|
30
|
+
parseConstant(xmlElement: Element): ConstantProps;
|
|
31
|
+
parsePhenomenon(xmlElement: Element): PhenomenonProps;
|
|
32
|
+
parseFormat(xmlElement: Element): FormatProps;
|
|
33
|
+
parseUnitSystem(xmlElement: Element): UnitSystemProps;
|
|
34
|
+
getProperties(xmlElement: Element, itemName: string): Iterable<[string, string, Element]>;
|
|
35
|
+
parsePrimitiveProperty(xmlElement: Element): PrimitivePropertyProps;
|
|
36
|
+
parseStructProperty(xmlElement: Element): StructPropertyProps;
|
|
37
|
+
parsePrimitiveArrayProperty(xmlElement: Element): PrimitiveArrayPropertyProps;
|
|
38
|
+
parseStructArrayProperty(xmlElement: Element): StructArrayPropertyProps;
|
|
39
|
+
parseNavigationProperty(xmlElement: Element): NavigationPropertyProps;
|
|
40
|
+
getSchemaCustomAttributeProviders(): Iterable<CAProviderTuple>;
|
|
41
|
+
getClassCustomAttributeProviders(xmlElement: Element): Iterable<CAProviderTuple>;
|
|
42
|
+
getPropertyCustomAttributeProviders(xmlElement: Element): Iterable<CAProviderTuple>;
|
|
43
|
+
getRelationshipConstraintCustomAttributeProviders(xmlElement: Element): [Iterable<CAProviderTuple>, Iterable<CAProviderTuple>];
|
|
44
|
+
private getElementChildren;
|
|
45
|
+
private getElementChildrenByTagName;
|
|
46
|
+
private getOptionalAttribute;
|
|
47
|
+
private getOptionalFloatAttribute;
|
|
48
|
+
private getOptionalIntAttribute;
|
|
49
|
+
private parseBoolean;
|
|
50
|
+
private getRequiredAttribute;
|
|
51
|
+
private getSchemaReference;
|
|
52
|
+
private getSchemaItemType;
|
|
53
|
+
private getSchemaChildren;
|
|
54
|
+
private getSchemaItemProps;
|
|
55
|
+
private getClassProps;
|
|
56
|
+
private getRelationshipConstraintProps;
|
|
57
|
+
private getPropertyType;
|
|
58
|
+
private getPropertyName;
|
|
59
|
+
private getPropertyProps;
|
|
60
|
+
private getPropertyTypeName;
|
|
61
|
+
private getPrimitiveOrEnumPropertyBaseProps;
|
|
62
|
+
private getPropertyMinAndMaxOccurs;
|
|
63
|
+
private getCustomAttributeProviders;
|
|
64
|
+
private getCustomAttributeProvider;
|
|
65
|
+
private addCAPropertyValues;
|
|
66
|
+
private readPropertyValue;
|
|
67
|
+
private readArrayPropertyValue;
|
|
68
|
+
private readPrimitiveArrayValues;
|
|
69
|
+
private readStructArrayValues;
|
|
70
|
+
private readStructPropertyValue;
|
|
71
|
+
private readPrimitivePropertyValue;
|
|
72
|
+
private getBooleanPropertyValue;
|
|
73
|
+
private getIntegerPropertyValue;
|
|
74
|
+
private getDatePropertyValue;
|
|
75
|
+
private getDoublePropertyValue;
|
|
76
|
+
private getPoint2DPropertyValue;
|
|
77
|
+
private getPoint3DPropertyValue;
|
|
78
|
+
private isSchemaFullNameValidForVersion;
|
|
79
|
+
private parseXmlNamespace;
|
|
80
|
+
private getQualifiedTypeName;
|
|
81
|
+
/** The rest of the API uses the full name format of `{SchemaName}.{SchemaItemName}`,
|
|
82
|
+
* meaning all of the references in the format string need to be changed.
|
|
83
|
+
*/
|
|
84
|
+
private getQualifiedPresentationUnits;
|
|
85
|
+
}
|
|
86
86
|
//# sourceMappingURL=XmlParser.d.ts.map
|