@itwin/ecschema-editing 3.4.0-dev.9 → 3.4.1

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.
Files changed (167) hide show
  1. package/CHANGELOG.md +51 -1
  2. package/lib/cjs/Editing/Constants.d.ts +20 -20
  3. package/lib/cjs/Editing/Constants.d.ts.map +1 -1
  4. package/lib/cjs/Editing/Constants.js +60 -64
  5. package/lib/cjs/Editing/Constants.js.map +1 -1
  6. package/lib/cjs/Editing/CustomAttributes.d.ts +20 -20
  7. package/lib/cjs/Editing/CustomAttributes.d.ts.map +1 -1
  8. package/lib/cjs/Editing/CustomAttributes.js +59 -62
  9. package/lib/cjs/Editing/CustomAttributes.js.map +1 -1
  10. package/lib/cjs/Editing/ECClasses.d.ts +54 -54
  11. package/lib/cjs/Editing/ECClasses.d.ts.map +1 -1
  12. package/lib/cjs/Editing/ECClasses.js +269 -269
  13. package/lib/cjs/Editing/ECClasses.js.map +1 -1
  14. package/lib/cjs/Editing/Editor.d.ts +112 -112
  15. package/lib/cjs/Editing/Editor.d.ts.map +1 -1
  16. package/lib/cjs/Editing/Editor.js +166 -166
  17. package/lib/cjs/Editing/Editor.js.map +1 -1
  18. package/lib/cjs/Editing/Entities.d.ts +25 -25
  19. package/lib/cjs/Editing/Entities.d.ts.map +1 -1
  20. package/lib/cjs/Editing/Entities.js +116 -124
  21. package/lib/cjs/Editing/Entities.js.map +1 -1
  22. package/lib/cjs/Editing/Enumerations.d.ts +21 -21
  23. package/lib/cjs/Editing/Enumerations.d.ts.map +1 -1
  24. package/lib/cjs/Editing/Enumerations.js +66 -76
  25. package/lib/cjs/Editing/Enumerations.js.map +1 -1
  26. package/lib/cjs/Editing/Formats.d.ts +21 -21
  27. package/lib/cjs/Editing/Formats.d.ts.map +1 -1
  28. package/lib/cjs/Editing/Formats.js +61 -63
  29. package/lib/cjs/Editing/Formats.js.map +1 -1
  30. package/lib/cjs/Editing/InvertedUnits.d.ts +17 -17
  31. package/lib/cjs/Editing/InvertedUnits.d.ts.map +1 -1
  32. package/lib/cjs/Editing/InvertedUnits.js +82 -85
  33. package/lib/cjs/Editing/InvertedUnits.js.map +1 -1
  34. package/lib/cjs/Editing/KindOfQuantities.d.ts +28 -28
  35. package/lib/cjs/Editing/KindOfQuantities.d.ts.map +1 -1
  36. package/lib/cjs/Editing/KindOfQuantities.js +78 -79
  37. package/lib/cjs/Editing/KindOfQuantities.js.map +1 -1
  38. package/lib/cjs/Editing/Mixins.d.ts +22 -22
  39. package/lib/cjs/Editing/Mixins.d.ts.map +1 -1
  40. package/lib/cjs/Editing/Mixins.js +84 -88
  41. package/lib/cjs/Editing/Mixins.js.map +1 -1
  42. package/lib/cjs/Editing/Mutable/MutableCAClass.d.ts +9 -9
  43. package/lib/cjs/Editing/Mutable/MutableCAClass.js +15 -15
  44. package/lib/cjs/Editing/Mutable/MutableCAClass.js.map +1 -1
  45. package/lib/cjs/Editing/Mutable/MutableClass.d.ts +34 -34
  46. package/lib/cjs/Editing/Mutable/MutableClass.js +22 -22
  47. package/lib/cjs/Editing/Mutable/MutableClass.js.map +1 -1
  48. package/lib/cjs/Editing/Mutable/MutableConstant.d.ts +12 -12
  49. package/lib/cjs/Editing/Mutable/MutableConstant.js +15 -15
  50. package/lib/cjs/Editing/Mutable/MutableConstant.js.map +1 -1
  51. package/lib/cjs/Editing/Mutable/MutableEntityClass.d.ts +15 -15
  52. package/lib/cjs/Editing/Mutable/MutableEntityClass.js +59 -59
  53. package/lib/cjs/Editing/Mutable/MutableEntityClass.js.map +1 -1
  54. package/lib/cjs/Editing/Mutable/MutableEnumeration.d.ts +9 -9
  55. package/lib/cjs/Editing/Mutable/MutableEnumeration.js +14 -14
  56. package/lib/cjs/Editing/Mutable/MutableEnumeration.js.map +1 -1
  57. package/lib/cjs/Editing/Mutable/MutableFormat.d.ts +18 -18
  58. package/lib/cjs/Editing/Mutable/MutableFormat.js +15 -15
  59. package/lib/cjs/Editing/Mutable/MutableFormat.js.map +1 -1
  60. package/lib/cjs/Editing/Mutable/MutableInvertedUnit.d.ts +10 -10
  61. package/lib/cjs/Editing/Mutable/MutableInvertedUnit.js +15 -15
  62. package/lib/cjs/Editing/Mutable/MutableInvertedUnit.js.map +1 -1
  63. package/lib/cjs/Editing/Mutable/MutableKindOfQuantity.d.ts +10 -10
  64. package/lib/cjs/Editing/Mutable/MutableKindOfQuantity.js +15 -15
  65. package/lib/cjs/Editing/Mutable/MutableKindOfQuantity.js.map +1 -1
  66. package/lib/cjs/Editing/Mutable/MutableMixin.d.ts +11 -11
  67. package/lib/cjs/Editing/Mutable/MutableMixin.js +15 -15
  68. package/lib/cjs/Editing/Mutable/MutableMixin.js.map +1 -1
  69. package/lib/cjs/Editing/Mutable/MutablePhenomenon.d.ts +9 -9
  70. package/lib/cjs/Editing/Mutable/MutablePhenomenon.js +15 -15
  71. package/lib/cjs/Editing/Mutable/MutablePhenomenon.js.map +1 -1
  72. package/lib/cjs/Editing/Mutable/MutableProperty.d.ts +8 -8
  73. package/lib/cjs/Editing/Mutable/MutableProperty.js +15 -15
  74. package/lib/cjs/Editing/Mutable/MutableProperty.js.map +1 -1
  75. package/lib/cjs/Editing/Mutable/MutablePropertyCategory.d.ts +9 -9
  76. package/lib/cjs/Editing/Mutable/MutablePropertyCategory.js +15 -15
  77. package/lib/cjs/Editing/Mutable/MutablePropertyCategory.js.map +1 -1
  78. package/lib/cjs/Editing/Mutable/MutableRelationshipClass.d.ts +21 -21
  79. package/lib/cjs/Editing/Mutable/MutableRelationshipClass.js +24 -24
  80. package/lib/cjs/Editing/Mutable/MutableRelationshipClass.js.map +1 -1
  81. package/lib/cjs/Editing/Mutable/MutableSchema.d.ts +45 -45
  82. package/lib/cjs/Editing/Mutable/MutableSchema.js +17 -17
  83. package/lib/cjs/Editing/Mutable/MutableSchema.js.map +1 -1
  84. package/lib/cjs/Editing/Mutable/MutableUnit.d.ts +11 -11
  85. package/lib/cjs/Editing/Mutable/MutableUnit.js +15 -15
  86. package/lib/cjs/Editing/Mutable/MutableUnit.js.map +1 -1
  87. package/lib/cjs/Editing/Mutable/MutableUnitSystem.d.ts +8 -8
  88. package/lib/cjs/Editing/Mutable/MutableUnitSystem.js +15 -15
  89. package/lib/cjs/Editing/Mutable/MutableUnitSystem.js.map +1 -1
  90. package/lib/cjs/Editing/Phenomena.d.ts +15 -15
  91. package/lib/cjs/Editing/Phenomena.d.ts.map +1 -1
  92. package/lib/cjs/Editing/Phenomena.js +44 -47
  93. package/lib/cjs/Editing/Phenomena.js.map +1 -1
  94. package/lib/cjs/Editing/PropertyCategories.d.ts +16 -16
  95. package/lib/cjs/Editing/PropertyCategories.d.ts.map +1 -1
  96. package/lib/cjs/Editing/PropertyCategories.js +51 -53
  97. package/lib/cjs/Editing/PropertyCategories.js.map +1 -1
  98. package/lib/cjs/Editing/RelationshipClasses.d.ts +21 -21
  99. package/lib/cjs/Editing/RelationshipClasses.d.ts.map +1 -1
  100. package/lib/cjs/Editing/RelationshipClasses.js +68 -69
  101. package/lib/cjs/Editing/RelationshipClasses.js.map +1 -1
  102. package/lib/cjs/Editing/Structs.d.ts +19 -19
  103. package/lib/cjs/Editing/Structs.d.ts.map +1 -1
  104. package/lib/cjs/Editing/Structs.js +57 -60
  105. package/lib/cjs/Editing/Structs.js.map +1 -1
  106. package/lib/cjs/Editing/UnitSystems.d.ts +15 -15
  107. package/lib/cjs/Editing/UnitSystems.d.ts.map +1 -1
  108. package/lib/cjs/Editing/UnitSystems.js +41 -43
  109. package/lib/cjs/Editing/UnitSystems.js.map +1 -1
  110. package/lib/cjs/Editing/Units.d.ts +15 -15
  111. package/lib/cjs/Editing/Units.d.ts.map +1 -1
  112. package/lib/cjs/Editing/Units.js +58 -61
  113. package/lib/cjs/Editing/Units.js.map +1 -1
  114. package/lib/cjs/Validation/Diagnostic.d.ts +321 -321
  115. package/lib/cjs/Validation/Diagnostic.js +310 -310
  116. package/lib/cjs/Validation/Diagnostic.js.map +1 -1
  117. package/lib/cjs/Validation/DiagnosticReporter.d.ts +96 -96
  118. package/lib/cjs/Validation/DiagnosticReporter.d.ts.map +1 -1
  119. package/lib/cjs/Validation/DiagnosticReporter.js +106 -106
  120. package/lib/cjs/Validation/DiagnosticReporter.js.map +1 -1
  121. package/lib/cjs/Validation/ECRules.d.ts +448 -438
  122. package/lib/cjs/Validation/ECRules.d.ts.map +1 -1
  123. package/lib/cjs/Validation/ECRules.js +593 -583
  124. package/lib/cjs/Validation/ECRules.js.map +1 -1
  125. package/lib/cjs/Validation/LoggingDiagnosticReporter.d.ts +13 -13
  126. package/lib/cjs/Validation/LoggingDiagnosticReporter.js +40 -40
  127. package/lib/cjs/Validation/LoggingDiagnosticReporter.js.map +1 -1
  128. package/lib/cjs/Validation/RuleSuppressionSet.d.ts +59 -58
  129. package/lib/cjs/Validation/RuleSuppressionSet.d.ts.map +1 -1
  130. package/lib/cjs/Validation/RuleSuppressionSet.js +9 -9
  131. package/lib/cjs/Validation/RuleSuppressionSet.js.map +1 -1
  132. package/lib/cjs/Validation/Rules.d.ts +64 -64
  133. package/lib/cjs/Validation/Rules.js +9 -9
  134. package/lib/cjs/Validation/Rules.js.map +1 -1
  135. package/lib/cjs/Validation/SchemaChanges.d.ts +607 -607
  136. package/lib/cjs/Validation/SchemaChanges.js +1135 -1135
  137. package/lib/cjs/Validation/SchemaChanges.js.map +1 -1
  138. package/lib/cjs/Validation/SchemaCompareDiagnostics.d.ts +422 -422
  139. package/lib/cjs/Validation/SchemaCompareDiagnostics.js +111 -111
  140. package/lib/cjs/Validation/SchemaCompareDiagnostics.js.map +1 -1
  141. package/lib/cjs/Validation/SchemaCompareReporter.d.ts +11 -11
  142. package/lib/cjs/Validation/SchemaCompareReporter.js +9 -9
  143. package/lib/cjs/Validation/SchemaCompareReporter.js.map +1 -1
  144. package/lib/cjs/Validation/SchemaCompareResultDelegate.d.ts +236 -236
  145. package/lib/cjs/Validation/SchemaCompareResultDelegate.js +348 -348
  146. package/lib/cjs/Validation/SchemaCompareResultDelegate.js.map +1 -1
  147. package/lib/cjs/Validation/SchemaCompareVisitor.d.ts +119 -119
  148. package/lib/cjs/Validation/SchemaCompareVisitor.js +206 -206
  149. package/lib/cjs/Validation/SchemaCompareVisitor.js.map +1 -1
  150. package/lib/cjs/Validation/SchemaComparer.d.ts +171 -171
  151. package/lib/cjs/Validation/SchemaComparer.js +666 -666
  152. package/lib/cjs/Validation/SchemaComparer.js.map +1 -1
  153. package/lib/cjs/Validation/SchemaValidater.d.ts +19 -19
  154. package/lib/cjs/Validation/SchemaValidater.js +61 -61
  155. package/lib/cjs/Validation/SchemaValidater.js.map +1 -1
  156. package/lib/cjs/Validation/SchemaValidationVisitor.d.ts +170 -170
  157. package/lib/cjs/Validation/SchemaValidationVisitor.d.ts.map +1 -1
  158. package/lib/cjs/Validation/SchemaValidationVisitor.js +492 -490
  159. package/lib/cjs/Validation/SchemaValidationVisitor.js.map +1 -1
  160. package/lib/cjs/Validation/SchemaWalker.d.ts +22 -22
  161. package/lib/cjs/Validation/SchemaWalker.js +51 -51
  162. package/lib/cjs/Validation/SchemaWalker.js.map +1 -1
  163. package/lib/cjs/ecschema-editing.d.ts +33 -33
  164. package/lib/cjs/ecschema-editing.js +54 -54
  165. package/lib/cjs/ecschema-editing.js.map +1 -1
  166. package/package.json +11 -11
  167. package/public/locales/en/ECSchemaEditing.json +26 -26
@@ -1,89 +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
- }
29
- if (baseClass !== undefined) {
30
- const baseClassItem = await schema.lookupItem(baseClass);
31
- if (baseClassItem === undefined)
32
- return { errorMessage: `Unable to locate base class ${baseClass.fullName} in schema ${schema.fullName}.` };
33
- if (baseClassItem.schemaItemType !== ecschema_metadata_1.SchemaItemType.Mixin)
34
- return { errorMessage: `${baseClassItem.fullName} is not of type Mixin.` };
35
- newClass.baseClass = new ecschema_metadata_1.DelayedPromiseWithProps(baseClass, async () => baseClassItem);
36
- }
37
- const newAppliesTo = (await this._schemaEditor.schemaContext.getSchemaItem(appliesTo));
38
- if (newAppliesTo === undefined || newAppliesTo.schemaItemType !== ecschema_metadata_1.SchemaItemType.EntityClass) {
39
- return { errorMessage: `Failed to locate the appliedTo entity class ${appliesTo.name}.` };
40
- }
41
- newClass.setAppliesTo(new ecschema_metadata_1.DelayedPromiseWithProps(newAppliesTo.key, async () => newAppliesTo));
42
- if (displayLabel) {
43
- newClass.setDisplayLabel(displayLabel);
44
- }
45
- return { itemKey: newClass.key };
46
- }
47
- /**
48
- * Creates a MixinClass through a MixinProps.
49
- * @param schemaKey a SchemaKey of the Schema that will house the new object.
50
- * @param mixinProps a json object that will be used to populate the new MixinClass. Needs a name value passed in.
51
- */
52
- async createFromProps(schemaKey, mixinProps) {
53
- const schema = await this._schemaEditor.getSchema(schemaKey);
54
- if (schema === undefined)
55
- return { errorMessage: `Schema Key ${schemaKey.toString(true)} not found in context` };
56
- if (mixinProps.name === undefined)
57
- return { errorMessage: `No name was supplied within props.` };
58
- const newClass = (await schema.createMixinClass(mixinProps.name));
59
- if (newClass === undefined) {
60
- return { errorMessage: `Failed to create class ${mixinProps.name} in schema ${schemaKey.toString(true)}.` };
61
- }
62
- await newClass.fromJSON(mixinProps);
63
- return { itemKey: newClass.key };
64
- }
65
- async addMixin(entityKey, mixinKey) {
66
- const entity = (await this._schemaEditor.schemaContext.getSchemaItem(entityKey));
67
- const mixin = (await this._schemaEditor.schemaContext.getSchemaItem(mixinKey));
68
- if (entity === undefined)
69
- throw new ecschema_metadata_1.ECObjectsError(ecschema_metadata_1.ECObjectsStatus.ClassNotFound, `Entity Class ${entityKey.fullName} not found in schema context.`);
70
- if (mixin === undefined)
71
- throw new ecschema_metadata_1.ECObjectsError(ecschema_metadata_1.ECObjectsStatus.ClassNotFound, `Mixin Class ${mixinKey.fullName} not found in schema context.`);
72
- if (entity.schemaItemType !== ecschema_metadata_1.SchemaItemType.EntityClass)
73
- throw new ecschema_metadata_1.ECObjectsError(ecschema_metadata_1.ECObjectsStatus.InvalidSchemaItemType, `Expected ${entityKey.fullName} to be of type Entity Class.`);
74
- if (mixin.schemaItemType !== ecschema_metadata_1.SchemaItemType.Mixin)
75
- throw new ecschema_metadata_1.ECObjectsError(ecschema_metadata_1.ECObjectsStatus.InvalidSchemaItemType, `Expected ${mixinKey.fullName} to be of type Mixin.`);
76
- entity.addMixin(mixin);
77
- }
78
- async createNavigationProperty(mixinKey, name, relationship, direction) {
79
- const mixin = (await this._schemaEditor.schemaContext.getSchemaItem(mixinKey));
80
- if (mixin === undefined)
81
- throw new ecschema_metadata_1.ECObjectsError(ecschema_metadata_1.ECObjectsStatus.ClassNotFound, `Mixin Class ${mixinKey.fullName} not found in schema context.`);
82
- if (mixin.schemaItemType !== ecschema_metadata_1.SchemaItemType.Mixin)
83
- throw new ecschema_metadata_1.ECObjectsError(ecschema_metadata_1.ECObjectsStatus.InvalidSchemaItemType, `Expected ${mixinKey.fullName} to be of type Mixin.`);
84
- await mixin.createNavigationProperty(name, relationship, direction);
85
- return { itemKey: mixinKey, propertyName: name };
86
- }
87
- }
88
- 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;
89
85
  //# sourceMappingURL=Mixins.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Mixins.js","sourceRoot":"","sources":["../../../src/Editing/Mixins.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,gEAGkC;AAElC,2CAAwC;AAIxC;;;GAGG;AACH,MAAa,MAAO,SAAQ,qBAAS;IACnC,YAAmB,aAAkC;QACnD,KAAK,CAAC,aAAa,CAAC,CAAC;IACvB,CAAC;IAEM,KAAK,CAAC,MAAM,CAAC,SAAoB,EAAE,IAAY,EAAE,SAAwB,EAAE,YAAqB,EAAE,SAAyB;QAChI,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;QAC7D,IAAI,MAAM,KAAK,SAAS;YAAE,OAAO,EAAE,YAAY,EAAE,cAAc,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,uBAAuB,EAAE,CAAC;QAEjH,MAAM,QAAQ,GAAI,CAAC,MAAM,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC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E,eAAe,QAAQ,CAAC,QAAQ,+BAA+B,CAAC,CAAC;QAClJ,IAAI,MAAM,CAAC,cAAc,KAAK,kCAAc,CAAC,WAAW;YAAE,MAAM,IAAI,kCAAc,CAAC,mCAAe,CAAC,qBAAqB,EAAE,YAAY,SAAS,CAAC,QAAQ,8BAA8B,CAAC,CAAC;QACxL,IAAI,KAAK,CAAC,cAAc,KAAK,kCAAc,CAAC,KAAK;YAAE,MAAM,IAAI,kCAAc,CAAC,mCAAe,CAAC,qBAAqB,EAAE,YAAY,QAAQ,CAAC,QAAQ,uBAAuB,CAAC,CAAC;QAEzK,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;IAEM,KAAK,CAAC,wBAAwB,CAAC,QAAuB,EAAE,IAAY,EAAE,YAAwC,EAAE,SAAqC;QAC1J,MAAM,KAAK,GAAG,CAAC,MAAM,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,aAAa,CAAe,QAAQ,CAAC,CAAC,CAAC;QAE7F,IAAI,KAAK,KAAK,SAAS;YAAE,MAAM,IAAI,kCAAc,CAAC,mCAAe,CAAC,aAAa,EAAE,eAAe,QAAQ,CAAC,QAAQ,+BAA+B,CAAC,CAAC;QAClJ,IAAI,KAAK,CAAC,cAAc,KAAK,kCAAc,CAAC,KAAK;YAAE,MAAM,IAAI,kCAAc,CAAC,mCAAe,CAAC,qBAAqB,EAAE,YAAY,QAAQ,CAAC,QAAQ,uBAAuB,CAAC,CAAC;QAEzK,MAAM,KAAK,CAAC,wBAAwB,CAAC,IAAI,EAAE,YAAY,EAAE,SAAS,CAAC,CAAC;QACpE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;IACnD,CAAC;CACF;AAvED,wBAuEC","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/** @packageDocumentation\r\n * @module Editing\r\n */\r\n\r\nimport {\r\n DelayedPromiseWithProps, ECObjectsError, ECObjectsStatus, EntityClass, Mixin, MixinProps, RelationshipClass,\r\n SchemaItemKey, SchemaItemType, SchemaKey, StrengthDirection,\r\n} from \"@itwin/ecschema-metadata\";\r\nimport { PropertyEditResults, SchemaContextEditor, SchemaItemEditResults } from \"./Editor\";\r\nimport { ECClasses } from \"./ECClasses\";\r\nimport { MutableMixin } from \"./Mutable/MutableMixin\";\r\nimport { MutableEntityClass } from \"./Mutable/MutableEntityClass\";\r\n\r\n/**\r\n * @alpha\r\n * A class extending ECClasses allowing you to create schema items of type Mixin.\r\n */\r\nexport class Mixins extends ECClasses {\r\n public constructor(_schemaEditor: SchemaContextEditor) {\r\n super(_schemaEditor);\r\n }\r\n\r\n public async create(schemaKey: SchemaKey, name: string, appliesTo: SchemaItemKey, displayLabel?: string, baseClass?: SchemaItemKey): Promise<SchemaItemEditResults> {\r\n const schema = await this._schemaEditor.getSchema(schemaKey);\r\n if (schema === undefined) return { errorMessage: `Schema Key ${schemaKey.toString(true)} not found in context` };\r\n\r\n const newClass = ((await schema.createMixinClass(name)) as MutableMixin);\r\n if (newClass === undefined) {\r\n return { errorMessage: `Failed to create class ${name} in schema ${schemaKey.toString(true)}.` };\r\n }\r\n\r\n if (baseClass !== undefined) {\r\n const baseClassItem = await schema.lookupItem<Mixin>(baseClass);\r\n if (baseClassItem === undefined) return { errorMessage: `Unable to locate base class ${baseClass.fullName} in schema ${schema.fullName}.` };\r\n if (baseClassItem.schemaItemType !== SchemaItemType.Mixin) return { errorMessage: `${baseClassItem.fullName} is not of type Mixin.` };\r\n newClass.baseClass = new DelayedPromiseWithProps<SchemaItemKey, Mixin>(baseClass, async () => baseClassItem);\r\n }\r\n\r\n const newAppliesTo = (await this._schemaEditor.schemaContext.getSchemaItem<EntityClass>(appliesTo));\r\n if (newAppliesTo === undefined || newAppliesTo.schemaItemType !== SchemaItemType.EntityClass) { return { errorMessage: `Failed to locate the appliedTo entity class ${appliesTo.name}.` }; }\r\n newClass.setAppliesTo(new DelayedPromiseWithProps<SchemaItemKey, EntityClass>(newAppliesTo.key, async () => newAppliesTo));\r\n\r\n if (displayLabel) { newClass.setDisplayLabel(displayLabel); }\r\n\r\n return { itemKey: newClass.key };\r\n }\r\n\r\n /**\r\n * Creates a MixinClass through a MixinProps.\r\n * @param schemaKey a SchemaKey of the Schema that will house the new object.\r\n * @param mixinProps a json object that will be used to populate the new MixinClass. Needs a name value passed in.\r\n */\r\n public async createFromProps(schemaKey: SchemaKey, mixinProps: MixinProps): Promise<SchemaItemEditResults> {\r\n const schema = await this._schemaEditor.getSchema(schemaKey);\r\n if (schema === undefined) return { errorMessage: `Schema Key ${schemaKey.toString(true)} not found in context` };\r\n\r\n if (mixinProps.name === undefined) return { errorMessage: `No name was supplied within props.` };\r\n const newClass = (await schema.createMixinClass(mixinProps.name)) as MutableMixin;\r\n if (newClass === undefined) {\r\n return { errorMessage: `Failed to create class ${mixinProps.name} in schema ${schemaKey.toString(true)}.` };\r\n }\r\n\r\n await newClass.fromJSON(mixinProps);\r\n\r\n return { itemKey: newClass.key };\r\n }\r\n\r\n public async addMixin(entityKey: SchemaItemKey, mixinKey: SchemaItemKey): Promise<void> {\r\n const entity = (await this._schemaEditor.schemaContext.getSchemaItem<MutableEntityClass>(entityKey));\r\n const mixin = (await this._schemaEditor.schemaContext.getSchemaItem<Mixin>(mixinKey));\r\n\r\n if (entity === undefined) throw new ECObjectsError(ECObjectsStatus.ClassNotFound, `Entity Class ${entityKey.fullName} not found in schema context.`);\r\n if (mixin === undefined) throw new ECObjectsError(ECObjectsStatus.ClassNotFound, `Mixin Class ${mixinKey.fullName} not found in schema context.`);\r\n if (entity.schemaItemType !== SchemaItemType.EntityClass) throw new ECObjectsError(ECObjectsStatus.InvalidSchemaItemType, `Expected ${entityKey.fullName} to be of type Entity Class.`);\r\n if (mixin.schemaItemType !== SchemaItemType.Mixin) throw new ECObjectsError(ECObjectsStatus.InvalidSchemaItemType, `Expected ${mixinKey.fullName} to be of type Mixin.`);\r\n\r\n entity.addMixin(mixin);\r\n }\r\n\r\n public async createNavigationProperty(mixinKey: SchemaItemKey, name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): Promise<PropertyEditResults> {\r\n const mixin = (await this._schemaEditor.schemaContext.getSchemaItem<MutableMixin>(mixinKey));\r\n\r\n if (mixin === undefined) throw new ECObjectsError(ECObjectsStatus.ClassNotFound, `Mixin Class ${mixinKey.fullName} not found in schema context.`);\r\n if (mixin.schemaItemType !== SchemaItemType.Mixin) throw new ECObjectsError(ECObjectsStatus.InvalidSchemaItemType, `Expected ${mixinKey.fullName} to be of type Mixin.`);\r\n\r\n await mixin.createNavigationProperty(name, relationship, direction);\r\n return { itemKey: mixinKey, propertyName: name };\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"Mixins.js","sourceRoot":"","sources":["../../../src/Editing/Mixins.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,gEAGkC;AAElC,2CAAwC;AAIxC;;;GAGG;AACH,MAAa,MAAO,SAAQ,qBAAS;IACnC,YAAmB,aAAkC;QACnD,KAAK,CAAC,aAAa,CAAC,CAAC;IACvB,CAAC;IAEM,KAAK,CAAC,MAAM,CAAC,SAAoB,EAAE,IAAY,EAAE,SAAwB,EAAE,YAAqB,EAAE,SAAyB;QAChI,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;QAC7D,IAAI,MAAM,KAAK,SAAS;YACtB,OAAO,EAAE,YAAY,EAAE,cAAc,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,uBAAuB,EAAE,CAAC;QAEzF,MAAM,QAAQ,GAAI,CAAC,MAAM,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAkB,CAAC;QACzE,IAAI,QAAQ,KAAK,SAAS;YACxB,OAAO,EAAE,YA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D,MAAM,IAAI,kCAAc,CAAC,mCAAe,CAAC,qBAAqB,EAAE,YAAY,SAAS,CAAC,QAAQ,8BAA8B,CAAC,CAAC;QAEhI,IAAI,KAAK,CAAC,cAAc,KAAK,kCAAc,CAAC,KAAK;YAC/C,MAAM,IAAI,kCAAc,CAAC,mCAAe,CAAC,qBAAqB,EAAE,YAAY,QAAQ,CAAC,QAAQ,uBAAuB,CAAC,CAAC;QAExH,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;IAEM,KAAK,CAAC,wBAAwB,CAAC,QAAuB,EAAE,IAAY,EAAE,YAAwC,EAAE,SAAqC;QAC1J,MAAM,KAAK,GAAG,CAAC,MAAM,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,aAAa,CAAe,QAAQ,CAAC,CAAC,CAAC;QAE7F,IAAI,KAAK,KAAK,SAAS;YACrB,MAAM,IAAI,kCAAc,CAAC,mCAAe,CAAC,aAAa,EAAE,eAAe,QAAQ,CAAC,QAAQ,+BAA+B,CAAC,CAAC;QAE3H,IAAI,KAAK,CAAC,cAAc,KAAK,kCAAc,CAAC,KAAK;YAC/C,MAAM,IAAI,kCAAc,CAAC,mCAAe,CAAC,qBAAqB,EAAE,YAAY,QAAQ,CAAC,QAAQ,uBAAuB,CAAC,CAAC;QAExH,MAAM,KAAK,CAAC,wBAAwB,CAAC,IAAI,EAAE,YAAY,EAAE,SAAS,CAAC,CAAC;QACpE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;IACnD,CAAC;CACF;AAzFD,wBAyFC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Editing\n */\n\nimport {\n DelayedPromiseWithProps, ECObjectsError, ECObjectsStatus, EntityClass, Mixin, MixinProps, RelationshipClass,\n SchemaItemKey, SchemaItemType, SchemaKey, StrengthDirection,\n} from \"@itwin/ecschema-metadata\";\nimport { PropertyEditResults, SchemaContextEditor, SchemaItemEditResults } from \"./Editor\";\nimport { ECClasses } from \"./ECClasses\";\nimport { MutableMixin } from \"./Mutable/MutableMixin\";\nimport { MutableEntityClass } from \"./Mutable/MutableEntityClass\";\n\n/**\n * @alpha\n * A class extending ECClasses allowing you to create schema items of type Mixin.\n */\nexport class Mixins extends ECClasses {\n public constructor(_schemaEditor: SchemaContextEditor) {\n super(_schemaEditor);\n }\n\n public async create(schemaKey: SchemaKey, name: string, appliesTo: SchemaItemKey, displayLabel?: string, baseClass?: SchemaItemKey): Promise<SchemaItemEditResults> {\n const schema = await this._schemaEditor.getSchema(schemaKey);\n if (schema === undefined)\n return { errorMessage: `Schema Key ${schemaKey.toString(true)} not found in context` };\n\n const newClass = ((await schema.createMixinClass(name)) as MutableMixin);\n if (newClass === undefined)\n return { errorMessage: `Failed to create class ${name} in schema ${schemaKey.toString(true)}.` };\n\n if (baseClass !== undefined) {\n const baseClassItem = await schema.lookupItem<Mixin>(baseClass);\n if (baseClassItem === undefined)\n return { errorMessage: `Unable to locate base class ${baseClass.fullName} in schema ${schema.fullName}.` };\n\n if (baseClassItem.schemaItemType !== SchemaItemType.Mixin)\n return { errorMessage: `${baseClassItem.fullName} is not of type Mixin.` };\n\n newClass.baseClass = new DelayedPromiseWithProps<SchemaItemKey, Mixin>(baseClass, async () => baseClassItem);\n }\n\n const newAppliesTo = (await this._schemaEditor.schemaContext.getSchemaItem<EntityClass>(appliesTo));\n if (newAppliesTo === undefined || newAppliesTo.schemaItemType !== SchemaItemType.EntityClass)\n return { errorMessage: `Failed to locate the appliedTo entity class ${appliesTo.name}.` };\n\n newClass.setAppliesTo(new DelayedPromiseWithProps<SchemaItemKey, EntityClass>(newAppliesTo.key, async () => newAppliesTo));\n\n if (displayLabel)\n newClass.setDisplayLabel(displayLabel);\n\n return { itemKey: newClass.key };\n }\n\n /**\n * Creates a MixinClass through a MixinProps.\n * @param schemaKey a SchemaKey of the Schema that will house the new object.\n * @param mixinProps a json object that will be used to populate the new MixinClass. Needs a name value passed in.\n */\n public async createFromProps(schemaKey: SchemaKey, mixinProps: MixinProps): Promise<SchemaItemEditResults> {\n const schema = await this._schemaEditor.getSchema(schemaKey);\n if (schema === undefined)\n return { errorMessage: `Schema Key ${schemaKey.toString(true)} not found in context` };\n\n if (mixinProps.name === undefined)\n return { errorMessage: `No name was supplied within props.` };\n\n const newClass = (await schema.createMixinClass(mixinProps.name)) as MutableMixin;\n if (newClass === undefined)\n return { errorMessage: `Failed to create class ${mixinProps.name} in schema ${schemaKey.toString(true)}.` };\n\n await newClass.fromJSON(mixinProps);\n return { itemKey: newClass.key };\n }\n\n public async addMixin(entityKey: SchemaItemKey, mixinKey: SchemaItemKey): Promise<void> {\n const entity = (await this._schemaEditor.schemaContext.getSchemaItem<MutableEntityClass>(entityKey));\n const mixin = (await this._schemaEditor.schemaContext.getSchemaItem<Mixin>(mixinKey));\n\n if (entity === undefined)\n throw new ECObjectsError(ECObjectsStatus.ClassNotFound, `Entity Class ${entityKey.fullName} not found in schema context.`);\n\n if (mixin === undefined)\n throw new ECObjectsError(ECObjectsStatus.ClassNotFound, `Mixin Class ${mixinKey.fullName} not found in schema context.`);\n\n if (entity.schemaItemType !== SchemaItemType.EntityClass)\n throw new ECObjectsError(ECObjectsStatus.InvalidSchemaItemType, `Expected ${entityKey.fullName} to be of type Entity Class.`);\n\n if (mixin.schemaItemType !== SchemaItemType.Mixin)\n throw new ECObjectsError(ECObjectsStatus.InvalidSchemaItemType, `Expected ${mixinKey.fullName} to be of type Mixin.`);\n\n entity.addMixin(mixin);\n }\n\n public async createNavigationProperty(mixinKey: SchemaItemKey, name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): Promise<PropertyEditResults> {\n const mixin = (await this._schemaEditor.schemaContext.getSchemaItem<MutableMixin>(mixinKey));\n\n if (mixin === undefined)\n throw new ECObjectsError(ECObjectsStatus.ClassNotFound, `Mixin Class ${mixinKey.fullName} not found in schema context.`);\n\n if (mixin.schemaItemType !== SchemaItemType.Mixin)\n throw new ECObjectsError(ECObjectsStatus.InvalidSchemaItemType, `Expected ${mixinKey.fullName} to be of type Mixin.`);\n\n await mixin.createNavigationProperty(name, relationship, direction);\n return { itemKey: mixinKey, propertyName: name };\n }\n}\n"]}
@@ -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 +1 @@
1
- {"version":3,"file":"MutableCAClass.js","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutableCAClass.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,gEAA8F;AAE9F;;;GAGG;AACH,MAAsB,cAAe,SAAQ,wCAAoB;CAGhE;AAHD,wCAGC","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\nimport { CustomAttributeClass, CustomAttributeContainerType } from \"@itwin/ecschema-metadata\";\r\n\r\n/**\r\n * @internal\r\n * An abstract class used for Schema editing.\r\n */\r\nexport abstract class MutableCAClass extends CustomAttributeClass {\r\n public abstract override setContainerType(containerType: CustomAttributeContainerType): void;\r\n public abstract override setDisplayLabel(displayLabel: string): void;\r\n}\r\n"]}
1
+ {"version":3,"file":"MutableCAClass.js","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutableCAClass.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,gEAA8F;AAE9F;;;GAGG;AACH,MAAsB,cAAe,SAAQ,wCAAoB;CAGhE;AAHD,wCAGC","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*--------------------------------------------------------------------------------------------*/\nimport { CustomAttributeClass, CustomAttributeContainerType } from \"@itwin/ecschema-metadata\";\n\n/**\n * @internal\n * An abstract class used for Schema editing.\n */\nexport abstract class MutableCAClass extends CustomAttributeClass {\n public abstract override setContainerType(containerType: CustomAttributeContainerType): void;\n public abstract override setDisplayLabel(displayLabel: string): void;\n}\n"]}
@@ -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 +1 @@
1
- {"version":3,"file":"MutableClass.js","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutableClass.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,gEAGkC;AAElC;;;GAGG;AACH,MAAsB,kBAAmB,SAAQ,+BAAW;CAE3D;AAFD,gDAEC;AAED;;;GAGG;AACH,MAAsB,YAAa,SAAQ,2BAAO;CA2BjD;AA3BD,oCA2BC","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\nimport {\r\n CustomAttribute, ECClass, ECClassModifier, Enumeration, EnumerationArrayProperty, EnumerationProperty, PrimitiveArrayProperty,\r\n PrimitiveProperty, PrimitiveType, Property, StructArrayProperty, StructClass, StructProperty,\r\n} from \"@itwin/ecschema-metadata\";\r\n\r\n/**\r\n * @internal\r\n * An abstract class used for schema editing.\r\n */\r\nexport abstract class MutableStructClass extends StructClass {\r\n public abstract override setDisplayLabel(displayLabel: string): void;\r\n}\r\n\r\n/**\r\n * Hackish approach that works like a \"friend class\" so we can access protected members without making them public.\r\n * @internal\r\n */\r\nexport abstract class MutableClass extends ECClass {\r\n public abstract override addCustomAttribute(customAttribute: CustomAttribute): void;\r\n public abstract override setModifier(modifier: ECClassModifier): void;\r\n public abstract override createPrimitiveProperty(name: string, primitiveType: PrimitiveType): Promise<PrimitiveProperty>;\r\n public abstract override createPrimitiveProperty(name: string, primitiveType: Enumeration): Promise<EnumerationProperty>;\r\n public abstract override createPrimitiveProperty(name: string, primitiveType?: string | PrimitiveType | Enumeration): Promise<Property>;\r\n\r\n public abstract override createPrimitivePropertySync(name: string, primitiveType: PrimitiveType): PrimitiveProperty;\r\n public abstract override createPrimitivePropertySync(name: string, primitiveType: Enumeration): EnumerationProperty;\r\n public abstract override createPrimitivePropertySync(name: string, primitiveType?: string | PrimitiveType | Enumeration): Property;\r\n\r\n public abstract override createPrimitiveArrayProperty(name: string, primitiveType: PrimitiveType): Promise<PrimitiveArrayProperty>;\r\n public abstract override createPrimitiveArrayProperty(name: string, primitiveType: Enumeration): Promise<EnumerationArrayProperty>;\r\n public abstract override createPrimitiveArrayProperty(name: string, primitiveType?: string | PrimitiveType | Enumeration): Promise<Property>;\r\n\r\n public abstract override createPrimitiveArrayPropertySync(name: string, primitiveType: PrimitiveType): PrimitiveArrayProperty;\r\n public abstract override createPrimitiveArrayPropertySync(name: string, primitiveType: Enumeration): EnumerationArrayProperty;\r\n public abstract override createPrimitiveArrayPropertySync(name: string, primitiveType?: string | PrimitiveType | Enumeration): Property;\r\n\r\n public abstract override createStructProperty(name: string, structType: string | StructClass): Promise<StructProperty>;\r\n public abstract override createStructPropertySync(name: string, structType: string | StructClass): StructProperty;\r\n\r\n public abstract override createStructArrayProperty(name: string, structType: string | StructClass): Promise<StructArrayProperty>;\r\n public abstract override createStructArrayPropertySync(name: string, structType: string | StructClass): StructArrayProperty;\r\n\r\n public abstract override deleteProperty(name: string): Promise<void>;\r\n public abstract override deletePropertySync(name: string): void;\r\n}\r\n"]}
1
+ {"version":3,"file":"MutableClass.js","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutableClass.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,gEAGkC;AAElC;;;GAGG;AACH,MAAsB,kBAAmB,SAAQ,+BAAW;CAE3D;AAFD,gDAEC;AAED;;;GAGG;AACH,MAAsB,YAAa,SAAQ,2BAAO;CA2BjD;AA3BD,oCA2BC","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*--------------------------------------------------------------------------------------------*/\nimport {\n CustomAttribute, ECClass, ECClassModifier, Enumeration, EnumerationArrayProperty, EnumerationProperty, PrimitiveArrayProperty,\n PrimitiveProperty, PrimitiveType, Property, StructArrayProperty, StructClass, StructProperty,\n} from \"@itwin/ecschema-metadata\";\n\n/**\n * @internal\n * An abstract class used for schema editing.\n */\nexport abstract class MutableStructClass extends StructClass {\n public abstract override setDisplayLabel(displayLabel: string): void;\n}\n\n/**\n * Hackish approach that works like a \"friend class\" so we can access protected members without making them public.\n * @internal\n */\nexport abstract class MutableClass extends ECClass {\n public abstract override addCustomAttribute(customAttribute: CustomAttribute): void;\n public abstract override setModifier(modifier: ECClassModifier): void;\n public abstract override createPrimitiveProperty(name: string, primitiveType: PrimitiveType): Promise<PrimitiveProperty>;\n public abstract override createPrimitiveProperty(name: string, primitiveType: Enumeration): Promise<EnumerationProperty>;\n public abstract override createPrimitiveProperty(name: string, primitiveType?: string | PrimitiveType | Enumeration): Promise<Property>;\n\n public abstract override createPrimitivePropertySync(name: string, primitiveType: PrimitiveType): PrimitiveProperty;\n public abstract override createPrimitivePropertySync(name: string, primitiveType: Enumeration): EnumerationProperty;\n public abstract override createPrimitivePropertySync(name: string, primitiveType?: string | PrimitiveType | Enumeration): Property;\n\n public abstract override createPrimitiveArrayProperty(name: string, primitiveType: PrimitiveType): Promise<PrimitiveArrayProperty>;\n public abstract override createPrimitiveArrayProperty(name: string, primitiveType: Enumeration): Promise<EnumerationArrayProperty>;\n public abstract override createPrimitiveArrayProperty(name: string, primitiveType?: string | PrimitiveType | Enumeration): Promise<Property>;\n\n public abstract override createPrimitiveArrayPropertySync(name: string, primitiveType: PrimitiveType): PrimitiveArrayProperty;\n public abstract override createPrimitiveArrayPropertySync(name: string, primitiveType: Enumeration): EnumerationArrayProperty;\n public abstract override createPrimitiveArrayPropertySync(name: string, primitiveType?: string | PrimitiveType | Enumeration): Property;\n\n public abstract override createStructProperty(name: string, structType: string | StructClass): Promise<StructProperty>;\n public abstract override createStructPropertySync(name: string, structType: string | StructClass): StructProperty;\n\n public abstract override createStructArrayProperty(name: string, structType: string | StructClass): Promise<StructArrayProperty>;\n public abstract override createStructArrayPropertySync(name: string, structType: string | StructClass): StructArrayProperty;\n\n public abstract override deleteProperty(name: string): Promise<void>;\n public abstract override deletePropertySync(name: string): void;\n}\n"]}
@@ -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 +1 @@
1
- {"version":3,"file":"MutableConstant.js","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutableConstant.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,gEAA0E;AAE1E;;;GAGG;AACH,MAAsB,eAAgB,SAAQ,4BAAQ;CAMrD;AAND,0CAMC","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\nimport { Constant, LazyLoadedPhenomenon } from \"@itwin/ecschema-metadata\";\r\n\r\n/**\r\n * @internal\r\n * An abstract class used for schema editing.\r\n */\r\nexport abstract class MutableConstant extends Constant {\r\n public abstract override setPhenomenon(phenomenon: LazyLoadedPhenomenon): void;\r\n public abstract override setDefinition(definition: string): void;\r\n public abstract override setNumerator(numerator: number): void;\r\n public abstract override setDenominator(denominator: number): void;\r\n public abstract override setDisplayLabel(displayLabel: string): void;\r\n}\r\n"]}
1
+ {"version":3,"file":"MutableConstant.js","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutableConstant.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,gEAA0E;AAE1E;;;GAGG;AACH,MAAsB,eAAgB,SAAQ,4BAAQ;CAMrD;AAND,0CAMC","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*--------------------------------------------------------------------------------------------*/\nimport { Constant, LazyLoadedPhenomenon } from \"@itwin/ecschema-metadata\";\n\n/**\n * @internal\n * An abstract class used for schema editing.\n */\nexport abstract class MutableConstant extends Constant {\n public abstract override setPhenomenon(phenomenon: LazyLoadedPhenomenon): void;\n public abstract override setDefinition(definition: string): void;\n public abstract override setNumerator(numerator: number): void;\n public abstract override setDenominator(denominator: number): void;\n public abstract override setDisplayLabel(displayLabel: string): void;\n}\n"]}
@@ -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