@itwin/ecschema-editing 4.0.0-dev.10 → 4.0.0-dev.100
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 +51 -1
- package/lib/cjs/Editing/Constants.d.ts +20 -20
- package/lib/cjs/Editing/Constants.js +60 -60
- package/lib/cjs/Editing/CustomAttributes.d.ts +20 -20
- package/lib/cjs/Editing/CustomAttributes.js +59 -59
- package/lib/cjs/Editing/ECClasses.d.ts +54 -54
- package/lib/cjs/Editing/ECClasses.js +269 -269
- package/lib/cjs/Editing/Editor.d.ts +112 -112
- package/lib/cjs/Editing/Editor.js +166 -166
- package/lib/cjs/Editing/Entities.d.ts +25 -25
- package/lib/cjs/Editing/Entities.js +116 -116
- package/lib/cjs/Editing/Entities.js.map +1 -1
- package/lib/cjs/Editing/Enumerations.d.ts +21 -21
- package/lib/cjs/Editing/Enumerations.js +66 -66
- package/lib/cjs/Editing/Formats.d.ts +21 -21
- package/lib/cjs/Editing/Formats.d.ts.map +1 -1
- package/lib/cjs/Editing/Formats.js +61 -61
- package/lib/cjs/Editing/Formats.js.map +1 -1
- package/lib/cjs/Editing/InvertedUnits.d.ts +17 -17
- package/lib/cjs/Editing/InvertedUnits.js +82 -82
- package/lib/cjs/Editing/KindOfQuantities.d.ts +28 -28
- package/lib/cjs/Editing/KindOfQuantities.js +78 -78
- package/lib/cjs/Editing/Mixins.d.ts +22 -22
- package/lib/cjs/Editing/Mixins.js +84 -84
- package/lib/cjs/Editing/Mutable/MutableCAClass.d.ts +9 -9
- package/lib/cjs/Editing/Mutable/MutableCAClass.js +15 -15
- package/lib/cjs/Editing/Mutable/MutableClass.d.ts +34 -34
- package/lib/cjs/Editing/Mutable/MutableClass.js +22 -22
- package/lib/cjs/Editing/Mutable/MutableConstant.d.ts +12 -12
- package/lib/cjs/Editing/Mutable/MutableConstant.js +15 -15
- package/lib/cjs/Editing/Mutable/MutableEntityClass.d.ts +15 -15
- package/lib/cjs/Editing/Mutable/MutableEntityClass.js +59 -59
- package/lib/cjs/Editing/Mutable/MutableEnumeration.d.ts +9 -9
- package/lib/cjs/Editing/Mutable/MutableEnumeration.js +14 -14
- package/lib/cjs/Editing/Mutable/MutableFormat.d.ts +18 -18
- package/lib/cjs/Editing/Mutable/MutableFormat.js +15 -15
- package/lib/cjs/Editing/Mutable/MutableInvertedUnit.d.ts +10 -10
- package/lib/cjs/Editing/Mutable/MutableInvertedUnit.js +15 -15
- package/lib/cjs/Editing/Mutable/MutableKindOfQuantity.d.ts +10 -10
- package/lib/cjs/Editing/Mutable/MutableKindOfQuantity.js +15 -15
- package/lib/cjs/Editing/Mutable/MutableMixin.d.ts +11 -11
- package/lib/cjs/Editing/Mutable/MutableMixin.js +15 -15
- package/lib/cjs/Editing/Mutable/MutablePhenomenon.d.ts +9 -9
- package/lib/cjs/Editing/Mutable/MutablePhenomenon.js +15 -15
- package/lib/cjs/Editing/Mutable/MutableProperty.d.ts +8 -8
- package/lib/cjs/Editing/Mutable/MutableProperty.js +15 -15
- package/lib/cjs/Editing/Mutable/MutablePropertyCategory.d.ts +9 -9
- package/lib/cjs/Editing/Mutable/MutablePropertyCategory.js +15 -15
- package/lib/cjs/Editing/Mutable/MutableRelationshipClass.d.ts +21 -21
- package/lib/cjs/Editing/Mutable/MutableRelationshipClass.js +24 -24
- package/lib/cjs/Editing/Mutable/MutableSchema.d.ts +45 -45
- package/lib/cjs/Editing/Mutable/MutableSchema.js +17 -17
- package/lib/cjs/Editing/Mutable/MutableUnit.d.ts +11 -11
- package/lib/cjs/Editing/Mutable/MutableUnit.js +15 -15
- package/lib/cjs/Editing/Mutable/MutableUnitSystem.d.ts +8 -8
- package/lib/cjs/Editing/Mutable/MutableUnitSystem.js +15 -15
- package/lib/cjs/Editing/Phenomena.d.ts +15 -15
- package/lib/cjs/Editing/Phenomena.js +44 -44
- package/lib/cjs/Editing/PropertyCategories.d.ts +16 -16
- package/lib/cjs/Editing/PropertyCategories.js +51 -51
- package/lib/cjs/Editing/RelationshipClasses.d.ts +21 -21
- package/lib/cjs/Editing/RelationshipClasses.js +68 -68
- package/lib/cjs/Editing/Structs.d.ts +19 -19
- package/lib/cjs/Editing/Structs.js +57 -57
- package/lib/cjs/Editing/UnitSystems.d.ts +15 -15
- package/lib/cjs/Editing/UnitSystems.js +41 -41
- package/lib/cjs/Editing/Units.d.ts +15 -15
- package/lib/cjs/Editing/Units.d.ts.map +1 -1
- package/lib/cjs/Editing/Units.js +58 -58
- package/lib/cjs/Editing/Units.js.map +1 -1
- package/lib/cjs/Validation/Diagnostic.d.ts +321 -321
- package/lib/cjs/Validation/Diagnostic.d.ts.map +1 -1
- package/lib/cjs/Validation/Diagnostic.js +310 -310
- package/lib/cjs/Validation/Diagnostic.js.map +1 -1
- package/lib/cjs/Validation/DiagnosticReporter.d.ts +96 -96
- package/lib/cjs/Validation/DiagnosticReporter.js +106 -106
- package/lib/cjs/Validation/ECRules.d.ts +443 -448
- package/lib/cjs/Validation/ECRules.d.ts.map +1 -1
- package/lib/cjs/Validation/ECRules.js +579 -593
- package/lib/cjs/Validation/ECRules.js.map +1 -1
- package/lib/cjs/Validation/LoggingDiagnosticReporter.d.ts +13 -13
- package/lib/cjs/Validation/LoggingDiagnosticReporter.js +40 -40
- package/lib/cjs/Validation/RuleSuppressionSet.d.ts +59 -59
- package/lib/cjs/Validation/RuleSuppressionSet.d.ts.map +1 -1
- package/lib/cjs/Validation/RuleSuppressionSet.js +9 -9
- package/lib/cjs/Validation/Rules.d.ts +64 -64
- package/lib/cjs/Validation/Rules.d.ts.map +1 -1
- package/lib/cjs/Validation/Rules.js +9 -9
- package/lib/cjs/Validation/SchemaChanges.d.ts +607 -607
- package/lib/cjs/Validation/SchemaChanges.js +1135 -1135
- package/lib/cjs/Validation/SchemaCompareDiagnostics.d.ts +422 -422
- package/lib/cjs/Validation/SchemaCompareDiagnostics.js +111 -111
- package/lib/cjs/Validation/SchemaCompareReporter.d.ts +11 -11
- package/lib/cjs/Validation/SchemaCompareReporter.js +9 -9
- package/lib/cjs/Validation/SchemaCompareResultDelegate.d.ts +236 -236
- package/lib/cjs/Validation/SchemaCompareResultDelegate.js +348 -348
- package/lib/cjs/Validation/SchemaCompareVisitor.d.ts +119 -119
- package/lib/cjs/Validation/SchemaCompareVisitor.js +206 -206
- package/lib/cjs/Validation/SchemaComparer.d.ts +171 -171
- package/lib/cjs/Validation/SchemaComparer.js +666 -666
- package/lib/cjs/Validation/SchemaValidater.d.ts +19 -19
- package/lib/cjs/Validation/SchemaValidater.js +61 -61
- package/lib/cjs/Validation/SchemaValidationVisitor.d.ts +170 -170
- package/lib/cjs/Validation/SchemaValidationVisitor.js +492 -492
- package/lib/cjs/Validation/SchemaWalker.d.ts +22 -22
- package/lib/cjs/Validation/SchemaWalker.js +51 -51
- package/lib/cjs/ecschema-editing.d.ts +33 -33
- package/lib/cjs/ecschema-editing.js +58 -54
- package/lib/cjs/ecschema-editing.js.map +1 -1
- package/package.json +16 -17
|
@@ -1,85 +1,85 @@
|
|
|
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
|
-
/** @packageDocumentation
|
|
7
|
-
* @module Editing
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.Mixins = void 0;
|
|
11
|
-
const ecschema_metadata_1 = require("@itwin/ecschema-metadata");
|
|
12
|
-
const ECClasses_1 = require("./ECClasses");
|
|
13
|
-
/**
|
|
14
|
-
* @alpha
|
|
15
|
-
* A class extending ECClasses allowing you to create schema items of type Mixin.
|
|
16
|
-
*/
|
|
17
|
-
class Mixins extends ECClasses_1.ECClasses {
|
|
18
|
-
constructor(_schemaEditor) {
|
|
19
|
-
super(_schemaEditor);
|
|
20
|
-
}
|
|
21
|
-
async create(schemaKey, name, appliesTo, displayLabel, baseClass) {
|
|
22
|
-
const schema = await this._schemaEditor.getSchema(schemaKey);
|
|
23
|
-
if (schema === undefined)
|
|
24
|
-
return { errorMessage: `Schema Key ${schemaKey.toString(true)} not found in context` };
|
|
25
|
-
const newClass = (await schema.createMixinClass(name));
|
|
26
|
-
if (newClass === undefined)
|
|
27
|
-
return { errorMessage: `Failed to create class ${name} in schema ${schemaKey.toString(true)}.` };
|
|
28
|
-
if (baseClass !== undefined) {
|
|
29
|
-
const baseClassItem = await schema.lookupItem(baseClass);
|
|
30
|
-
if (baseClassItem === undefined)
|
|
31
|
-
return { errorMessage: `Unable to locate base class ${baseClass.fullName} in schema ${schema.fullName}.` };
|
|
32
|
-
if (baseClassItem.schemaItemType !== ecschema_metadata_1.SchemaItemType.Mixin)
|
|
33
|
-
return { errorMessage: `${baseClassItem.fullName} is not of type Mixin.` };
|
|
34
|
-
newClass.baseClass = new ecschema_metadata_1.DelayedPromiseWithProps(baseClass, async () => baseClassItem);
|
|
35
|
-
}
|
|
36
|
-
const newAppliesTo = (await this._schemaEditor.schemaContext.getSchemaItem(appliesTo));
|
|
37
|
-
if (newAppliesTo === undefined || newAppliesTo.schemaItemType !== ecschema_metadata_1.SchemaItemType.EntityClass)
|
|
38
|
-
return { errorMessage: `Failed to locate the appliedTo entity class ${appliesTo.name}.` };
|
|
39
|
-
newClass.setAppliesTo(new ecschema_metadata_1.DelayedPromiseWithProps(newAppliesTo.key, async () => newAppliesTo));
|
|
40
|
-
if (displayLabel)
|
|
41
|
-
newClass.setDisplayLabel(displayLabel);
|
|
42
|
-
return { itemKey: newClass.key };
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Creates a MixinClass through a MixinProps.
|
|
46
|
-
* @param schemaKey a SchemaKey of the Schema that will house the new object.
|
|
47
|
-
* @param mixinProps a json object that will be used to populate the new MixinClass. Needs a name value passed in.
|
|
48
|
-
*/
|
|
49
|
-
async createFromProps(schemaKey, mixinProps) {
|
|
50
|
-
const schema = await this._schemaEditor.getSchema(schemaKey);
|
|
51
|
-
if (schema === undefined)
|
|
52
|
-
return { errorMessage: `Schema Key ${schemaKey.toString(true)} not found in context` };
|
|
53
|
-
if (mixinProps.name === undefined)
|
|
54
|
-
return { errorMessage: `No name was supplied within props.` };
|
|
55
|
-
const newClass = (await schema.createMixinClass(mixinProps.name));
|
|
56
|
-
if (newClass === undefined)
|
|
57
|
-
return { errorMessage: `Failed to create class ${mixinProps.name} in schema ${schemaKey.toString(true)}.` };
|
|
58
|
-
await newClass.fromJSON(mixinProps);
|
|
59
|
-
return { itemKey: newClass.key };
|
|
60
|
-
}
|
|
61
|
-
async addMixin(entityKey, mixinKey) {
|
|
62
|
-
const entity = (await this._schemaEditor.schemaContext.getSchemaItem(entityKey));
|
|
63
|
-
const mixin = (await this._schemaEditor.schemaContext.getSchemaItem(mixinKey));
|
|
64
|
-
if (entity === undefined)
|
|
65
|
-
throw new ecschema_metadata_1.ECObjectsError(ecschema_metadata_1.ECObjectsStatus.ClassNotFound, `Entity Class ${entityKey.fullName} not found in schema context.`);
|
|
66
|
-
if (mixin === undefined)
|
|
67
|
-
throw new ecschema_metadata_1.ECObjectsError(ecschema_metadata_1.ECObjectsStatus.ClassNotFound, `Mixin Class ${mixinKey.fullName} not found in schema context.`);
|
|
68
|
-
if (entity.schemaItemType !== ecschema_metadata_1.SchemaItemType.EntityClass)
|
|
69
|
-
throw new ecschema_metadata_1.ECObjectsError(ecschema_metadata_1.ECObjectsStatus.InvalidSchemaItemType, `Expected ${entityKey.fullName} to be of type Entity Class.`);
|
|
70
|
-
if (mixin.schemaItemType !== ecschema_metadata_1.SchemaItemType.Mixin)
|
|
71
|
-
throw new ecschema_metadata_1.ECObjectsError(ecschema_metadata_1.ECObjectsStatus.InvalidSchemaItemType, `Expected ${mixinKey.fullName} to be of type Mixin.`);
|
|
72
|
-
entity.addMixin(mixin);
|
|
73
|
-
}
|
|
74
|
-
async createNavigationProperty(mixinKey, name, relationship, direction) {
|
|
75
|
-
const mixin = (await this._schemaEditor.schemaContext.getSchemaItem(mixinKey));
|
|
76
|
-
if (mixin === undefined)
|
|
77
|
-
throw new ecschema_metadata_1.ECObjectsError(ecschema_metadata_1.ECObjectsStatus.ClassNotFound, `Mixin Class ${mixinKey.fullName} not found in schema context.`);
|
|
78
|
-
if (mixin.schemaItemType !== ecschema_metadata_1.SchemaItemType.Mixin)
|
|
79
|
-
throw new ecschema_metadata_1.ECObjectsError(ecschema_metadata_1.ECObjectsStatus.InvalidSchemaItemType, `Expected ${mixinKey.fullName} to be of type Mixin.`);
|
|
80
|
-
await mixin.createNavigationProperty(name, relationship, direction);
|
|
81
|
-
return { itemKey: mixinKey, propertyName: name };
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
exports.Mixins = Mixins;
|
|
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
|
+
/** @packageDocumentation
|
|
7
|
+
* @module Editing
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.Mixins = void 0;
|
|
11
|
+
const ecschema_metadata_1 = require("@itwin/ecschema-metadata");
|
|
12
|
+
const ECClasses_1 = require("./ECClasses");
|
|
13
|
+
/**
|
|
14
|
+
* @alpha
|
|
15
|
+
* A class extending ECClasses allowing you to create schema items of type Mixin.
|
|
16
|
+
*/
|
|
17
|
+
class Mixins extends ECClasses_1.ECClasses {
|
|
18
|
+
constructor(_schemaEditor) {
|
|
19
|
+
super(_schemaEditor);
|
|
20
|
+
}
|
|
21
|
+
async create(schemaKey, name, appliesTo, displayLabel, baseClass) {
|
|
22
|
+
const schema = await this._schemaEditor.getSchema(schemaKey);
|
|
23
|
+
if (schema === undefined)
|
|
24
|
+
return { errorMessage: `Schema Key ${schemaKey.toString(true)} not found in context` };
|
|
25
|
+
const newClass = (await schema.createMixinClass(name));
|
|
26
|
+
if (newClass === undefined)
|
|
27
|
+
return { errorMessage: `Failed to create class ${name} in schema ${schemaKey.toString(true)}.` };
|
|
28
|
+
if (baseClass !== undefined) {
|
|
29
|
+
const baseClassItem = await schema.lookupItem(baseClass);
|
|
30
|
+
if (baseClassItem === undefined)
|
|
31
|
+
return { errorMessage: `Unable to locate base class ${baseClass.fullName} in schema ${schema.fullName}.` };
|
|
32
|
+
if (baseClassItem.schemaItemType !== ecschema_metadata_1.SchemaItemType.Mixin)
|
|
33
|
+
return { errorMessage: `${baseClassItem.fullName} is not of type Mixin.` };
|
|
34
|
+
newClass.baseClass = new ecschema_metadata_1.DelayedPromiseWithProps(baseClass, async () => baseClassItem);
|
|
35
|
+
}
|
|
36
|
+
const newAppliesTo = (await this._schemaEditor.schemaContext.getSchemaItem(appliesTo));
|
|
37
|
+
if (newAppliesTo === undefined || newAppliesTo.schemaItemType !== ecschema_metadata_1.SchemaItemType.EntityClass)
|
|
38
|
+
return { errorMessage: `Failed to locate the appliedTo entity class ${appliesTo.name}.` };
|
|
39
|
+
newClass.setAppliesTo(new ecschema_metadata_1.DelayedPromiseWithProps(newAppliesTo.key, async () => newAppliesTo));
|
|
40
|
+
if (displayLabel)
|
|
41
|
+
newClass.setDisplayLabel(displayLabel);
|
|
42
|
+
return { itemKey: newClass.key };
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Creates a MixinClass through a MixinProps.
|
|
46
|
+
* @param schemaKey a SchemaKey of the Schema that will house the new object.
|
|
47
|
+
* @param mixinProps a json object that will be used to populate the new MixinClass. Needs a name value passed in.
|
|
48
|
+
*/
|
|
49
|
+
async createFromProps(schemaKey, mixinProps) {
|
|
50
|
+
const schema = await this._schemaEditor.getSchema(schemaKey);
|
|
51
|
+
if (schema === undefined)
|
|
52
|
+
return { errorMessage: `Schema Key ${schemaKey.toString(true)} not found in context` };
|
|
53
|
+
if (mixinProps.name === undefined)
|
|
54
|
+
return { errorMessage: `No name was supplied within props.` };
|
|
55
|
+
const newClass = (await schema.createMixinClass(mixinProps.name));
|
|
56
|
+
if (newClass === undefined)
|
|
57
|
+
return { errorMessage: `Failed to create class ${mixinProps.name} in schema ${schemaKey.toString(true)}.` };
|
|
58
|
+
await newClass.fromJSON(mixinProps);
|
|
59
|
+
return { itemKey: newClass.key };
|
|
60
|
+
}
|
|
61
|
+
async addMixin(entityKey, mixinKey) {
|
|
62
|
+
const entity = (await this._schemaEditor.schemaContext.getSchemaItem(entityKey));
|
|
63
|
+
const mixin = (await this._schemaEditor.schemaContext.getSchemaItem(mixinKey));
|
|
64
|
+
if (entity === undefined)
|
|
65
|
+
throw new ecschema_metadata_1.ECObjectsError(ecschema_metadata_1.ECObjectsStatus.ClassNotFound, `Entity Class ${entityKey.fullName} not found in schema context.`);
|
|
66
|
+
if (mixin === undefined)
|
|
67
|
+
throw new ecschema_metadata_1.ECObjectsError(ecschema_metadata_1.ECObjectsStatus.ClassNotFound, `Mixin Class ${mixinKey.fullName} not found in schema context.`);
|
|
68
|
+
if (entity.schemaItemType !== ecschema_metadata_1.SchemaItemType.EntityClass)
|
|
69
|
+
throw new ecschema_metadata_1.ECObjectsError(ecschema_metadata_1.ECObjectsStatus.InvalidSchemaItemType, `Expected ${entityKey.fullName} to be of type Entity Class.`);
|
|
70
|
+
if (mixin.schemaItemType !== ecschema_metadata_1.SchemaItemType.Mixin)
|
|
71
|
+
throw new ecschema_metadata_1.ECObjectsError(ecschema_metadata_1.ECObjectsStatus.InvalidSchemaItemType, `Expected ${mixinKey.fullName} to be of type Mixin.`);
|
|
72
|
+
entity.addMixin(mixin);
|
|
73
|
+
}
|
|
74
|
+
async createNavigationProperty(mixinKey, name, relationship, direction) {
|
|
75
|
+
const mixin = (await this._schemaEditor.schemaContext.getSchemaItem(mixinKey));
|
|
76
|
+
if (mixin === undefined)
|
|
77
|
+
throw new ecschema_metadata_1.ECObjectsError(ecschema_metadata_1.ECObjectsStatus.ClassNotFound, `Mixin Class ${mixinKey.fullName} not found in schema context.`);
|
|
78
|
+
if (mixin.schemaItemType !== ecschema_metadata_1.SchemaItemType.Mixin)
|
|
79
|
+
throw new ecschema_metadata_1.ECObjectsError(ecschema_metadata_1.ECObjectsStatus.InvalidSchemaItemType, `Expected ${mixinKey.fullName} to be of type Mixin.`);
|
|
80
|
+
await mixin.createNavigationProperty(name, relationship, direction);
|
|
81
|
+
return { itemKey: mixinKey, propertyName: name };
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
exports.Mixins = Mixins;
|
|
85
85
|
//# sourceMappingURL=Mixins.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { CustomAttributeClass, CustomAttributeContainerType } from "@itwin/ecschema-metadata";
|
|
2
|
-
/**
|
|
3
|
-
* @internal
|
|
4
|
-
* An abstract class used for Schema editing.
|
|
5
|
-
*/
|
|
6
|
-
export declare abstract class MutableCAClass extends CustomAttributeClass {
|
|
7
|
-
abstract setContainerType(containerType: CustomAttributeContainerType): void;
|
|
8
|
-
abstract setDisplayLabel(displayLabel: string): void;
|
|
9
|
-
}
|
|
1
|
+
import { CustomAttributeClass, CustomAttributeContainerType } from "@itwin/ecschema-metadata";
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
* An abstract class used for Schema editing.
|
|
5
|
+
*/
|
|
6
|
+
export declare abstract class MutableCAClass extends CustomAttributeClass {
|
|
7
|
+
abstract setContainerType(containerType: CustomAttributeContainerType): void;
|
|
8
|
+
abstract setDisplayLabel(displayLabel: string): void;
|
|
9
|
+
}
|
|
10
10
|
//# sourceMappingURL=MutableCAClass.d.ts.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MutableCAClass = void 0;
|
|
4
|
-
/*---------------------------------------------------------------------------------------------
|
|
5
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
6
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
7
|
-
*--------------------------------------------------------------------------------------------*/
|
|
8
|
-
const ecschema_metadata_1 = require("@itwin/ecschema-metadata");
|
|
9
|
-
/**
|
|
10
|
-
* @internal
|
|
11
|
-
* An abstract class used for Schema editing.
|
|
12
|
-
*/
|
|
13
|
-
class MutableCAClass extends ecschema_metadata_1.CustomAttributeClass {
|
|
14
|
-
}
|
|
15
|
-
exports.MutableCAClass = MutableCAClass;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MutableCAClass = void 0;
|
|
4
|
+
/*---------------------------------------------------------------------------------------------
|
|
5
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
6
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
7
|
+
*--------------------------------------------------------------------------------------------*/
|
|
8
|
+
const ecschema_metadata_1 = require("@itwin/ecschema-metadata");
|
|
9
|
+
/**
|
|
10
|
+
* @internal
|
|
11
|
+
* An abstract class used for Schema editing.
|
|
12
|
+
*/
|
|
13
|
+
class MutableCAClass extends ecschema_metadata_1.CustomAttributeClass {
|
|
14
|
+
}
|
|
15
|
+
exports.MutableCAClass = MutableCAClass;
|
|
16
16
|
//# sourceMappingURL=MutableCAClass.js.map
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { CustomAttribute, ECClass, ECClassModifier, Enumeration, EnumerationArrayProperty, EnumerationProperty, PrimitiveArrayProperty, PrimitiveProperty, PrimitiveType, Property, StructArrayProperty, StructClass, StructProperty } from "@itwin/ecschema-metadata";
|
|
2
|
-
/**
|
|
3
|
-
* @internal
|
|
4
|
-
* An abstract class used for schema editing.
|
|
5
|
-
*/
|
|
6
|
-
export declare abstract class MutableStructClass extends StructClass {
|
|
7
|
-
abstract setDisplayLabel(displayLabel: string): void;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Hackish approach that works like a "friend class" so we can access protected members without making them public.
|
|
11
|
-
* @internal
|
|
12
|
-
*/
|
|
13
|
-
export declare abstract class MutableClass extends ECClass {
|
|
14
|
-
abstract addCustomAttribute(customAttribute: CustomAttribute): void;
|
|
15
|
-
abstract setModifier(modifier: ECClassModifier): void;
|
|
16
|
-
abstract createPrimitiveProperty(name: string, primitiveType: PrimitiveType): Promise<PrimitiveProperty>;
|
|
17
|
-
abstract createPrimitiveProperty(name: string, primitiveType: Enumeration): Promise<EnumerationProperty>;
|
|
18
|
-
abstract createPrimitiveProperty(name: string, primitiveType?: string | PrimitiveType | Enumeration): Promise<Property>;
|
|
19
|
-
abstract createPrimitivePropertySync(name: string, primitiveType: PrimitiveType): PrimitiveProperty;
|
|
20
|
-
abstract createPrimitivePropertySync(name: string, primitiveType: Enumeration): EnumerationProperty;
|
|
21
|
-
abstract createPrimitivePropertySync(name: string, primitiveType?: string | PrimitiveType | Enumeration): Property;
|
|
22
|
-
abstract createPrimitiveArrayProperty(name: string, primitiveType: PrimitiveType): Promise<PrimitiveArrayProperty>;
|
|
23
|
-
abstract createPrimitiveArrayProperty(name: string, primitiveType: Enumeration): Promise<EnumerationArrayProperty>;
|
|
24
|
-
abstract createPrimitiveArrayProperty(name: string, primitiveType?: string | PrimitiveType | Enumeration): Promise<Property>;
|
|
25
|
-
abstract createPrimitiveArrayPropertySync(name: string, primitiveType: PrimitiveType): PrimitiveArrayProperty;
|
|
26
|
-
abstract createPrimitiveArrayPropertySync(name: string, primitiveType: Enumeration): EnumerationArrayProperty;
|
|
27
|
-
abstract createPrimitiveArrayPropertySync(name: string, primitiveType?: string | PrimitiveType | Enumeration): Property;
|
|
28
|
-
abstract createStructProperty(name: string, structType: string | StructClass): Promise<StructProperty>;
|
|
29
|
-
abstract createStructPropertySync(name: string, structType: string | StructClass): StructProperty;
|
|
30
|
-
abstract createStructArrayProperty(name: string, structType: string | StructClass): Promise<StructArrayProperty>;
|
|
31
|
-
abstract createStructArrayPropertySync(name: string, structType: string | StructClass): StructArrayProperty;
|
|
32
|
-
abstract deleteProperty(name: string): Promise<void>;
|
|
33
|
-
abstract deletePropertySync(name: string): void;
|
|
34
|
-
}
|
|
1
|
+
import { CustomAttribute, ECClass, ECClassModifier, Enumeration, EnumerationArrayProperty, EnumerationProperty, PrimitiveArrayProperty, PrimitiveProperty, PrimitiveType, Property, StructArrayProperty, StructClass, StructProperty } from "@itwin/ecschema-metadata";
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
* An abstract class used for schema editing.
|
|
5
|
+
*/
|
|
6
|
+
export declare abstract class MutableStructClass extends StructClass {
|
|
7
|
+
abstract setDisplayLabel(displayLabel: string): void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Hackish approach that works like a "friend class" so we can access protected members without making them public.
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export declare abstract class MutableClass extends ECClass {
|
|
14
|
+
abstract addCustomAttribute(customAttribute: CustomAttribute): void;
|
|
15
|
+
abstract setModifier(modifier: ECClassModifier): void;
|
|
16
|
+
abstract createPrimitiveProperty(name: string, primitiveType: PrimitiveType): Promise<PrimitiveProperty>;
|
|
17
|
+
abstract createPrimitiveProperty(name: string, primitiveType: Enumeration): Promise<EnumerationProperty>;
|
|
18
|
+
abstract createPrimitiveProperty(name: string, primitiveType?: string | PrimitiveType | Enumeration): Promise<Property>;
|
|
19
|
+
abstract createPrimitivePropertySync(name: string, primitiveType: PrimitiveType): PrimitiveProperty;
|
|
20
|
+
abstract createPrimitivePropertySync(name: string, primitiveType: Enumeration): EnumerationProperty;
|
|
21
|
+
abstract createPrimitivePropertySync(name: string, primitiveType?: string | PrimitiveType | Enumeration): Property;
|
|
22
|
+
abstract createPrimitiveArrayProperty(name: string, primitiveType: PrimitiveType): Promise<PrimitiveArrayProperty>;
|
|
23
|
+
abstract createPrimitiveArrayProperty(name: string, primitiveType: Enumeration): Promise<EnumerationArrayProperty>;
|
|
24
|
+
abstract createPrimitiveArrayProperty(name: string, primitiveType?: string | PrimitiveType | Enumeration): Promise<Property>;
|
|
25
|
+
abstract createPrimitiveArrayPropertySync(name: string, primitiveType: PrimitiveType): PrimitiveArrayProperty;
|
|
26
|
+
abstract createPrimitiveArrayPropertySync(name: string, primitiveType: Enumeration): EnumerationArrayProperty;
|
|
27
|
+
abstract createPrimitiveArrayPropertySync(name: string, primitiveType?: string | PrimitiveType | Enumeration): Property;
|
|
28
|
+
abstract createStructProperty(name: string, structType: string | StructClass): Promise<StructProperty>;
|
|
29
|
+
abstract createStructPropertySync(name: string, structType: string | StructClass): StructProperty;
|
|
30
|
+
abstract createStructArrayProperty(name: string, structType: string | StructClass): Promise<StructArrayProperty>;
|
|
31
|
+
abstract createStructArrayPropertySync(name: string, structType: string | StructClass): StructArrayProperty;
|
|
32
|
+
abstract deleteProperty(name: string): Promise<void>;
|
|
33
|
+
abstract deletePropertySync(name: string): void;
|
|
34
|
+
}
|
|
35
35
|
//# sourceMappingURL=MutableClass.d.ts.map
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MutableClass = exports.MutableStructClass = void 0;
|
|
4
|
-
/*---------------------------------------------------------------------------------------------
|
|
5
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
6
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
7
|
-
*--------------------------------------------------------------------------------------------*/
|
|
8
|
-
const ecschema_metadata_1 = require("@itwin/ecschema-metadata");
|
|
9
|
-
/**
|
|
10
|
-
* @internal
|
|
11
|
-
* An abstract class used for schema editing.
|
|
12
|
-
*/
|
|
13
|
-
class MutableStructClass extends ecschema_metadata_1.StructClass {
|
|
14
|
-
}
|
|
15
|
-
exports.MutableStructClass = MutableStructClass;
|
|
16
|
-
/**
|
|
17
|
-
* Hackish approach that works like a "friend class" so we can access protected members without making them public.
|
|
18
|
-
* @internal
|
|
19
|
-
*/
|
|
20
|
-
class MutableClass extends ecschema_metadata_1.ECClass {
|
|
21
|
-
}
|
|
22
|
-
exports.MutableClass = MutableClass;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MutableClass = exports.MutableStructClass = void 0;
|
|
4
|
+
/*---------------------------------------------------------------------------------------------
|
|
5
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
6
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
7
|
+
*--------------------------------------------------------------------------------------------*/
|
|
8
|
+
const ecschema_metadata_1 = require("@itwin/ecschema-metadata");
|
|
9
|
+
/**
|
|
10
|
+
* @internal
|
|
11
|
+
* An abstract class used for schema editing.
|
|
12
|
+
*/
|
|
13
|
+
class MutableStructClass extends ecschema_metadata_1.StructClass {
|
|
14
|
+
}
|
|
15
|
+
exports.MutableStructClass = MutableStructClass;
|
|
16
|
+
/**
|
|
17
|
+
* Hackish approach that works like a "friend class" so we can access protected members without making them public.
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
class MutableClass extends ecschema_metadata_1.ECClass {
|
|
21
|
+
}
|
|
22
|
+
exports.MutableClass = MutableClass;
|
|
23
23
|
//# sourceMappingURL=MutableClass.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Constant, LazyLoadedPhenomenon } from "@itwin/ecschema-metadata";
|
|
2
|
-
/**
|
|
3
|
-
* @internal
|
|
4
|
-
* An abstract class used for schema editing.
|
|
5
|
-
*/
|
|
6
|
-
export declare abstract class MutableConstant extends Constant {
|
|
7
|
-
abstract setPhenomenon(phenomenon: LazyLoadedPhenomenon): void;
|
|
8
|
-
abstract setDefinition(definition: string): void;
|
|
9
|
-
abstract setNumerator(numerator: number): void;
|
|
10
|
-
abstract setDenominator(denominator: number): void;
|
|
11
|
-
abstract setDisplayLabel(displayLabel: string): void;
|
|
12
|
-
}
|
|
1
|
+
import { Constant, LazyLoadedPhenomenon } from "@itwin/ecschema-metadata";
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
* An abstract class used for schema editing.
|
|
5
|
+
*/
|
|
6
|
+
export declare abstract class MutableConstant extends Constant {
|
|
7
|
+
abstract setPhenomenon(phenomenon: LazyLoadedPhenomenon): void;
|
|
8
|
+
abstract setDefinition(definition: string): void;
|
|
9
|
+
abstract setNumerator(numerator: number): void;
|
|
10
|
+
abstract setDenominator(denominator: number): void;
|
|
11
|
+
abstract setDisplayLabel(displayLabel: string): void;
|
|
12
|
+
}
|
|
13
13
|
//# sourceMappingURL=MutableConstant.d.ts.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MutableConstant = void 0;
|
|
4
|
-
/*---------------------------------------------------------------------------------------------
|
|
5
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
6
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
7
|
-
*--------------------------------------------------------------------------------------------*/
|
|
8
|
-
const ecschema_metadata_1 = require("@itwin/ecschema-metadata");
|
|
9
|
-
/**
|
|
10
|
-
* @internal
|
|
11
|
-
* An abstract class used for schema editing.
|
|
12
|
-
*/
|
|
13
|
-
class MutableConstant extends ecschema_metadata_1.Constant {
|
|
14
|
-
}
|
|
15
|
-
exports.MutableConstant = MutableConstant;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MutableConstant = void 0;
|
|
4
|
+
/*---------------------------------------------------------------------------------------------
|
|
5
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
6
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
7
|
+
*--------------------------------------------------------------------------------------------*/
|
|
8
|
+
const ecschema_metadata_1 = require("@itwin/ecschema-metadata");
|
|
9
|
+
/**
|
|
10
|
+
* @internal
|
|
11
|
+
* An abstract class used for schema editing.
|
|
12
|
+
*/
|
|
13
|
+
class MutableConstant extends ecschema_metadata_1.Constant {
|
|
14
|
+
}
|
|
15
|
+
exports.MutableConstant = MutableConstant;
|
|
16
16
|
//# sourceMappingURL=MutableConstant.js.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { ECClass, EntityClass, Mixin, NavigationProperty, RelationshipClass, StrengthDirection } from "@itwin/ecschema-metadata";
|
|
2
|
-
/**
|
|
3
|
-
* Hackish approach that works like a "friend class" so we can access protected members without making them public.
|
|
4
|
-
* @internal
|
|
5
|
-
*/
|
|
6
|
-
export declare abstract class MutableEntityClass extends EntityClass {
|
|
7
|
-
abstract addMixin(mixin: Mixin): any;
|
|
8
|
-
abstract createNavigationProperty(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): Promise<NavigationProperty>;
|
|
9
|
-
abstract createNavigationPropertySync(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): NavigationProperty;
|
|
10
|
-
abstract setDisplayLabel(displayLabel: string): void;
|
|
11
|
-
}
|
|
12
|
-
/** @internal */
|
|
13
|
-
export declare function createNavigationProperty(ecClass: ECClass, name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): Promise<NavigationProperty>;
|
|
14
|
-
/** @internal */
|
|
15
|
-
export declare function createNavigationPropertySync(ecClass: ECClass, name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): NavigationProperty;
|
|
1
|
+
import { ECClass, EntityClass, Mixin, NavigationProperty, RelationshipClass, StrengthDirection } from "@itwin/ecschema-metadata";
|
|
2
|
+
/**
|
|
3
|
+
* Hackish approach that works like a "friend class" so we can access protected members without making them public.
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export declare abstract class MutableEntityClass extends EntityClass {
|
|
7
|
+
abstract addMixin(mixin: Mixin): any;
|
|
8
|
+
abstract createNavigationProperty(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): Promise<NavigationProperty>;
|
|
9
|
+
abstract createNavigationPropertySync(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): NavigationProperty;
|
|
10
|
+
abstract setDisplayLabel(displayLabel: string): void;
|
|
11
|
+
}
|
|
12
|
+
/** @internal */
|
|
13
|
+
export declare function createNavigationProperty(ecClass: ECClass, name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): Promise<NavigationProperty>;
|
|
14
|
+
/** @internal */
|
|
15
|
+
export declare function createNavigationPropertySync(ecClass: ECClass, name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): NavigationProperty;
|
|
16
16
|
//# sourceMappingURL=MutableEntityClass.d.ts.map
|
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createNavigationPropertySync = exports.createNavigationProperty = exports.MutableEntityClass = void 0;
|
|
4
|
-
/*---------------------------------------------------------------------------------------------
|
|
5
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
6
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
7
|
-
*--------------------------------------------------------------------------------------------*/
|
|
8
|
-
const ecschema_metadata_1 = require("@itwin/ecschema-metadata");
|
|
9
|
-
/**
|
|
10
|
-
* Hackish approach that works like a "friend class" so we can access protected members without making them public.
|
|
11
|
-
* @internal
|
|
12
|
-
*/
|
|
13
|
-
class MutableEntityClass extends ecschema_metadata_1.EntityClass {
|
|
14
|
-
}
|
|
15
|
-
exports.MutableEntityClass = MutableEntityClass;
|
|
16
|
-
/** @internal */
|
|
17
|
-
async function createNavigationProperty(ecClass, name, relationship, direction) {
|
|
18
|
-
if (await ecClass.getProperty(name))
|
|
19
|
-
throw new ecschema_metadata_1.ECObjectsError(ecschema_metadata_1.ECObjectsStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${ecClass.name}.`);
|
|
20
|
-
let resolvedRelationship;
|
|
21
|
-
if (typeof (relationship) === "string") {
|
|
22
|
-
resolvedRelationship = await ecClass.schema.lookupItem(relationship);
|
|
23
|
-
}
|
|
24
|
-
else
|
|
25
|
-
resolvedRelationship = relationship;
|
|
26
|
-
if (!resolvedRelationship)
|
|
27
|
-
throw new ecschema_metadata_1.ECObjectsError(ecschema_metadata_1.ECObjectsStatus.InvalidType, `The provided RelationshipClass, ${relationship}, is not a valid RelationshipClassInterface.`);
|
|
28
|
-
if (typeof (direction) === "string") {
|
|
29
|
-
const tmpDirection = (0, ecschema_metadata_1.parseStrengthDirection)(direction);
|
|
30
|
-
if (undefined === tmpDirection)
|
|
31
|
-
throw new ecschema_metadata_1.ECObjectsError(ecschema_metadata_1.ECObjectsStatus.InvalidStrengthDirection, `The provided StrengthDirection, ${direction}, is not a valid StrengthDirection.`);
|
|
32
|
-
direction = tmpDirection;
|
|
33
|
-
}
|
|
34
|
-
const lazyRelationship = new ecschema_metadata_1.DelayedPromiseWithProps(resolvedRelationship.key, async () => resolvedRelationship);
|
|
35
|
-
return new ecschema_metadata_1.NavigationProperty(ecClass, name, lazyRelationship, direction);
|
|
36
|
-
}
|
|
37
|
-
exports.createNavigationProperty = createNavigationProperty;
|
|
38
|
-
/** @internal */
|
|
39
|
-
function createNavigationPropertySync(ecClass, name, relationship, direction) {
|
|
40
|
-
if (ecClass.getPropertySync(name))
|
|
41
|
-
throw new ecschema_metadata_1.ECObjectsError(ecschema_metadata_1.ECObjectsStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${ecClass.name}.`);
|
|
42
|
-
let resolvedRelationship;
|
|
43
|
-
if (typeof (relationship) === "string") {
|
|
44
|
-
resolvedRelationship = ecClass.schema.lookupItemSync(relationship);
|
|
45
|
-
}
|
|
46
|
-
else
|
|
47
|
-
resolvedRelationship = relationship;
|
|
48
|
-
if (!resolvedRelationship)
|
|
49
|
-
throw new ecschema_metadata_1.ECObjectsError(ecschema_metadata_1.ECObjectsStatus.InvalidType, `The provided RelationshipClass, ${relationship}, is not a valid RelationshipClassInterface.`);
|
|
50
|
-
if (typeof (direction) === "string") {
|
|
51
|
-
const tmpDirection = (0, ecschema_metadata_1.parseStrengthDirection)(direction);
|
|
52
|
-
if (undefined === tmpDirection)
|
|
53
|
-
throw new ecschema_metadata_1.ECObjectsError(ecschema_metadata_1.ECObjectsStatus.InvalidStrengthDirection, `The provided StrengthDirection, ${direction}, is not a valid StrengthDirection.`);
|
|
54
|
-
direction = tmpDirection;
|
|
55
|
-
}
|
|
56
|
-
const lazyRelationship = new ecschema_metadata_1.DelayedPromiseWithProps(resolvedRelationship.key, async () => resolvedRelationship);
|
|
57
|
-
return new ecschema_metadata_1.NavigationProperty(ecClass, name, lazyRelationship, direction);
|
|
58
|
-
}
|
|
59
|
-
exports.createNavigationPropertySync = createNavigationPropertySync;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createNavigationPropertySync = exports.createNavigationProperty = exports.MutableEntityClass = void 0;
|
|
4
|
+
/*---------------------------------------------------------------------------------------------
|
|
5
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
6
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
7
|
+
*--------------------------------------------------------------------------------------------*/
|
|
8
|
+
const ecschema_metadata_1 = require("@itwin/ecschema-metadata");
|
|
9
|
+
/**
|
|
10
|
+
* Hackish approach that works like a "friend class" so we can access protected members without making them public.
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
class MutableEntityClass extends ecschema_metadata_1.EntityClass {
|
|
14
|
+
}
|
|
15
|
+
exports.MutableEntityClass = MutableEntityClass;
|
|
16
|
+
/** @internal */
|
|
17
|
+
async function createNavigationProperty(ecClass, name, relationship, direction) {
|
|
18
|
+
if (await ecClass.getProperty(name))
|
|
19
|
+
throw new ecschema_metadata_1.ECObjectsError(ecschema_metadata_1.ECObjectsStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${ecClass.name}.`);
|
|
20
|
+
let resolvedRelationship;
|
|
21
|
+
if (typeof (relationship) === "string") {
|
|
22
|
+
resolvedRelationship = await ecClass.schema.lookupItem(relationship);
|
|
23
|
+
}
|
|
24
|
+
else
|
|
25
|
+
resolvedRelationship = relationship;
|
|
26
|
+
if (!resolvedRelationship)
|
|
27
|
+
throw new ecschema_metadata_1.ECObjectsError(ecschema_metadata_1.ECObjectsStatus.InvalidType, `The provided RelationshipClass, ${relationship}, is not a valid RelationshipClassInterface.`);
|
|
28
|
+
if (typeof (direction) === "string") {
|
|
29
|
+
const tmpDirection = (0, ecschema_metadata_1.parseStrengthDirection)(direction);
|
|
30
|
+
if (undefined === tmpDirection)
|
|
31
|
+
throw new ecschema_metadata_1.ECObjectsError(ecschema_metadata_1.ECObjectsStatus.InvalidStrengthDirection, `The provided StrengthDirection, ${direction}, is not a valid StrengthDirection.`);
|
|
32
|
+
direction = tmpDirection;
|
|
33
|
+
}
|
|
34
|
+
const lazyRelationship = new ecschema_metadata_1.DelayedPromiseWithProps(resolvedRelationship.key, async () => resolvedRelationship);
|
|
35
|
+
return new ecschema_metadata_1.NavigationProperty(ecClass, name, lazyRelationship, direction);
|
|
36
|
+
}
|
|
37
|
+
exports.createNavigationProperty = createNavigationProperty;
|
|
38
|
+
/** @internal */
|
|
39
|
+
function createNavigationPropertySync(ecClass, name, relationship, direction) {
|
|
40
|
+
if (ecClass.getPropertySync(name))
|
|
41
|
+
throw new ecschema_metadata_1.ECObjectsError(ecschema_metadata_1.ECObjectsStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${ecClass.name}.`);
|
|
42
|
+
let resolvedRelationship;
|
|
43
|
+
if (typeof (relationship) === "string") {
|
|
44
|
+
resolvedRelationship = ecClass.schema.lookupItemSync(relationship);
|
|
45
|
+
}
|
|
46
|
+
else
|
|
47
|
+
resolvedRelationship = relationship;
|
|
48
|
+
if (!resolvedRelationship)
|
|
49
|
+
throw new ecschema_metadata_1.ECObjectsError(ecschema_metadata_1.ECObjectsStatus.InvalidType, `The provided RelationshipClass, ${relationship}, is not a valid RelationshipClassInterface.`);
|
|
50
|
+
if (typeof (direction) === "string") {
|
|
51
|
+
const tmpDirection = (0, ecschema_metadata_1.parseStrengthDirection)(direction);
|
|
52
|
+
if (undefined === tmpDirection)
|
|
53
|
+
throw new ecschema_metadata_1.ECObjectsError(ecschema_metadata_1.ECObjectsStatus.InvalidStrengthDirection, `The provided StrengthDirection, ${direction}, is not a valid StrengthDirection.`);
|
|
54
|
+
direction = tmpDirection;
|
|
55
|
+
}
|
|
56
|
+
const lazyRelationship = new ecschema_metadata_1.DelayedPromiseWithProps(resolvedRelationship.key, async () => resolvedRelationship);
|
|
57
|
+
return new ecschema_metadata_1.NavigationProperty(ecClass, name, lazyRelationship, direction);
|
|
58
|
+
}
|
|
59
|
+
exports.createNavigationPropertySync = createNavigationPropertySync;
|
|
60
60
|
//# sourceMappingURL=MutableEntityClass.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { AnyEnumerator, Enumeration } from "@itwin/ecschema-metadata";
|
|
2
|
-
/** @internal
|
|
3
|
-
* An abstract class used for schema editing.
|
|
4
|
-
*/
|
|
5
|
-
export declare abstract class MutableEnumeration extends Enumeration {
|
|
6
|
-
abstract addEnumerator(enumerator: AnyEnumerator): void;
|
|
7
|
-
abstract setIsStrict(isStrict: boolean): void;
|
|
8
|
-
abstract setDisplayLabel(displayLabel: string): void;
|
|
9
|
-
}
|
|
1
|
+
import { AnyEnumerator, Enumeration } from "@itwin/ecschema-metadata";
|
|
2
|
+
/** @internal
|
|
3
|
+
* An abstract class used for schema editing.
|
|
4
|
+
*/
|
|
5
|
+
export declare abstract class MutableEnumeration extends Enumeration {
|
|
6
|
+
abstract addEnumerator(enumerator: AnyEnumerator): void;
|
|
7
|
+
abstract setIsStrict(isStrict: boolean): void;
|
|
8
|
+
abstract setDisplayLabel(displayLabel: string): void;
|
|
9
|
+
}
|
|
10
10
|
//# sourceMappingURL=MutableEnumeration.d.ts.map
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MutableEnumeration = void 0;
|
|
4
|
-
/*---------------------------------------------------------------------------------------------
|
|
5
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
6
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
7
|
-
*--------------------------------------------------------------------------------------------*/
|
|
8
|
-
const ecschema_metadata_1 = require("@itwin/ecschema-metadata");
|
|
9
|
-
/** @internal
|
|
10
|
-
* An abstract class used for schema editing.
|
|
11
|
-
*/
|
|
12
|
-
class MutableEnumeration extends ecschema_metadata_1.Enumeration {
|
|
13
|
-
}
|
|
14
|
-
exports.MutableEnumeration = MutableEnumeration;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MutableEnumeration = void 0;
|
|
4
|
+
/*---------------------------------------------------------------------------------------------
|
|
5
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
6
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
7
|
+
*--------------------------------------------------------------------------------------------*/
|
|
8
|
+
const ecschema_metadata_1 = require("@itwin/ecschema-metadata");
|
|
9
|
+
/** @internal
|
|
10
|
+
* An abstract class used for schema editing.
|
|
11
|
+
*/
|
|
12
|
+
class MutableEnumeration extends ecschema_metadata_1.Enumeration {
|
|
13
|
+
}
|
|
14
|
+
exports.MutableEnumeration = MutableEnumeration;
|
|
15
15
|
//# sourceMappingURL=MutableEnumeration.js.map
|