@itwin/ecschema-editing 4.3.0-dev.2 → 4.3.0-dev.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/Editing/Editor.d.ts +3 -0
- package/lib/cjs/Editing/Editor.d.ts.map +1 -1
- package/lib/cjs/Editing/Editor.js +3 -0
- package/lib/cjs/Editing/Editor.js.map +1 -1
- package/lib/cjs/Editing/Enumerations.d.ts +2 -0
- package/lib/cjs/Editing/Enumerations.d.ts.map +1 -1
- package/lib/cjs/Editing/Enumerations.js +22 -0
- package/lib/cjs/Editing/Enumerations.js.map +1 -1
- package/lib/cjs/Editing/SchemaItems.d.ts +15 -0
- package/lib/cjs/Editing/SchemaItems.d.ts.map +1 -0
- package/lib/cjs/Editing/SchemaItems.js +28 -0
- package/lib/cjs/Editing/SchemaItems.js.map +1 -0
- package/lib/cjs/Merging/CAClassMerger.d.ts +8 -2
- package/lib/cjs/Merging/CAClassMerger.d.ts.map +1 -1
- package/lib/cjs/Merging/CAClassMerger.js +12 -20
- package/lib/cjs/Merging/CAClassMerger.js.map +1 -1
- package/lib/cjs/Merging/ClassMerger.d.ts +7 -2
- package/lib/cjs/Merging/ClassMerger.d.ts.map +1 -1
- package/lib/cjs/Merging/ClassMerger.js +41 -45
- package/lib/cjs/Merging/ClassMerger.js.map +1 -1
- package/lib/cjs/Merging/ConstantMerger.d.ts +7 -7
- package/lib/cjs/Merging/ConstantMerger.d.ts.map +1 -1
- package/lib/cjs/Merging/ConstantMerger.js +37 -46
- package/lib/cjs/Merging/ConstantMerger.js.map +1 -1
- package/lib/cjs/Merging/EnumerationMerger.d.ts +8 -7
- package/lib/cjs/Merging/EnumerationMerger.d.ts.map +1 -1
- package/lib/cjs/Merging/EnumerationMerger.js +38 -67
- package/lib/cjs/Merging/EnumerationMerger.js.map +1 -1
- package/lib/cjs/Merging/SchemaItemFactory.d.ts +9 -2
- package/lib/cjs/Merging/SchemaItemFactory.d.ts.map +1 -1
- package/lib/cjs/Merging/SchemaItemFactory.js +45 -11
- package/lib/cjs/Merging/SchemaItemFactory.js.map +1 -1
- package/lib/cjs/Merging/SchemaItemMerger.d.ts +49 -20
- package/lib/cjs/Merging/SchemaItemMerger.d.ts.map +1 -1
- package/lib/cjs/Merging/SchemaItemMerger.js +76 -71
- package/lib/cjs/Merging/SchemaItemMerger.js.map +1 -1
- package/lib/cjs/Merging/SchemaMerger.d.ts +2 -0
- package/lib/cjs/Merging/SchemaMerger.d.ts.map +1 -1
- package/lib/cjs/Merging/SchemaMerger.js +29 -21
- package/lib/cjs/Merging/SchemaMerger.js.map +1 -1
- package/lib/cjs/Merging/SchemaReferenceMerger.d.ts.map +1 -1
- package/lib/cjs/Merging/SchemaReferenceMerger.js +8 -10
- package/lib/cjs/Merging/SchemaReferenceMerger.js.map +1 -1
- package/package.json +9 -9
- package/lib/cjs/Merging/PhenomenonMerger.d.ts +0 -7
- package/lib/cjs/Merging/PhenomenonMerger.d.ts.map +0 -1
- package/lib/cjs/Merging/PhenomenonMerger.js +0 -16
- package/lib/cjs/Merging/PhenomenonMerger.js.map +0 -1
- package/lib/cjs/Merging/PropertyCategoryMerger.d.ts +0 -7
- package/lib/cjs/Merging/PropertyCategoryMerger.d.ts.map +0 -1
- package/lib/cjs/Merging/PropertyCategoryMerger.js +0 -16
- package/lib/cjs/Merging/PropertyCategoryMerger.js.map +0 -1
|
@@ -17,6 +17,7 @@ import { RelationshipClasses } from "./RelationshipClasses";
|
|
|
17
17
|
import { Structs } from "./Structs";
|
|
18
18
|
import { Units } from "./Units";
|
|
19
19
|
import { UnitSystems } from "./UnitSystems";
|
|
20
|
+
import { SchemaItems } from "./SchemaItems";
|
|
20
21
|
/**
|
|
21
22
|
* @alpha
|
|
22
23
|
*/
|
|
@@ -59,6 +60,8 @@ export declare class SchemaContextEditor {
|
|
|
59
60
|
readonly unitSystems: UnitSystems;
|
|
60
61
|
readonly propertyCategories: PropertyCategories;
|
|
61
62
|
readonly invertedUnits: InvertedUnits;
|
|
63
|
+
/** @internal */
|
|
64
|
+
readonly schemaItems: SchemaItems;
|
|
62
65
|
/**
|
|
63
66
|
* Creates a new SchemaContextEditor instance.
|
|
64
67
|
* @param schemaContext The SchemaContext the Editor will use to edit in.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Editor.d.ts","sourceRoot":"","sources":["../../../src/Editing/Editor.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,eAAe,EAAmC,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,SAAS,EAAmB,MAAM,0BAA0B,CAAC;AAC9J,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAI5C;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,YAAY,CAAC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AAI,OAAO,CAAC,aAAa,CAAC;IAI7C;;;MAGE;IACW,SAAS,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC;IAOpE;;;;;;;;OAQG;IACU,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAMnJ;;;;OAIG;IACU,kBAAkB,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAyBpG;;;;OAIG;IACU,kBAAkB,CAAC,SAAS,EAAE,SAAS,EAAE,eAAe,EAAE,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAsBnH;;;;;;OAMG;IACU,UAAU,CAAC,SAAS,EAAE,SAAS,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAS7I;;;OAGG;IACU,qBAAqB,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,iBAAiB,CAAC;IASpF,OAAO,CAAC,eAAe;IAOvB,OAAO,CAAC,qBAAqB;CAK9B"}
|
|
@@ -25,6 +25,7 @@ const RelationshipClasses_1 = require("./RelationshipClasses");
|
|
|
25
25
|
const Structs_1 = require("./Structs");
|
|
26
26
|
const Units_1 = require("./Units");
|
|
27
27
|
const UnitSystems_1 = require("./UnitSystems");
|
|
28
|
+
const SchemaItems_1 = require("./SchemaItems");
|
|
28
29
|
/**
|
|
29
30
|
* A class that allows you to edit and create schemas, classes, and items from the SchemaContext level.
|
|
30
31
|
* @alpha
|
|
@@ -49,6 +50,8 @@ class SchemaContextEditor {
|
|
|
49
50
|
this.unitSystems = new UnitSystems_1.UnitSystems(this);
|
|
50
51
|
this.propertyCategories = new PropertyCategories_1.PropertyCategories(this);
|
|
51
52
|
this.invertedUnits = new InvertedUnits_1.InvertedUnits(this);
|
|
53
|
+
/** @internal */
|
|
54
|
+
this.schemaItems = new SchemaItems_1.SchemaItems(this);
|
|
52
55
|
// TODO: Make copy
|
|
53
56
|
this._schemaContext = schemaContext;
|
|
54
57
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Editor.js","sourceRoot":"","sources":["../../../src/Editing/Editor.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,+CAA+C;AAC/C,gEAA8J;AAE9J,sDAA6C;AAC7C,2CAAwC;AACxC,yDAAsD;AACtD,yCAAsC;AACtC,iDAA8C;AAC9C,uCAAoC;AACpC,mDAAgD;AAChD,yDAAsD;AACtD,qCAAkC;AAClC,2CAAwC;AACxC,6DAA0D;AAC1D,+DAA4D;AAC5D,uCAAoC;AACpC,mCAAgC;AAChC,+CAA4C;AA6B5C;;;GAGG;AACH,MAAa,mBAAmB;IAiB9B;;;OAGG;IACH,YAAY,aAA4B;QAnBxB,aAAQ,GAAG,IAAI,mBAAQ,CAAC,IAAI,CAAC,CAAC;QAC9B,WAAM,GAAG,IAAI,eAAM,CAAC,IAAI,CAAC,CAAC;QAC1B,YAAO,GAAG,IAAI,iBAAO,CAAC,IAAI,CAAC,CAAC;QAC5B,qBAAgB,GAAG,IAAI,mCAAgB,CAAC,IAAI,CAAC,CAAC;QAC9C,kBAAa,GAAG,IAAI,yCAAmB,CAAC,IAAI,CAAC,CAAC;QAC9C,cAAS,GAAG,IAAI,qBAAS,CAAC,IAAI,CAAC,CAAC;QAChC,iBAAY,GAAG,IAAI,2BAAY,CAAC,IAAI,CAAC,CAAC;QACtC,YAAO,GAAG,IAAI,iBAAO,CAAC,IAAI,CAAC,CAAC;QAC5B,qBAAgB,GAAG,IAAI,mCAAgB,CAAC,IAAI,CAAC,CAAC;QAC9C,UAAK,GAAG,IAAI,aAAK,CAAC,IAA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AC,CAAC;QAC7F,IAAI,MAAM,KAAK,SAAS;YACtB,OAAO,EAAE,YAAY,EAAE,cAAc,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,uBAAuB,EAAE,CAAC;QAEzF,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC;QACpF,OAAO,EAAE,CAAC;IACZ,CAAC;IAEO,eAAe,CAAC,MAAc,EAAE,SAAiB;QACvD,MAAM,KAAK,GAAW,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAC3D,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE;YAChB,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;SACpC;IACH,CAAC;IAEO,qBAAqB,CAAC,MAAc,EAAE,eAAgC;QAC5E,IAAA,qBAAM,EAAC,MAAM,CAAC,gBAAgB,KAAK,SAAS,CAAC,CAAC;QAC9C,MAAM,GAAG,GAAG,MAAM,CAAC,gBAAgD,CAAC;QACpE,GAAG,CAAC,MAAM,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;IACxC,CAAC;CACF;AA7JD,kDA6JC","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 * as Rules from \"../Validation/ECRules\";\r\nimport { CustomAttribute, ECObjectsError, ECObjectsStatus, Schema, SchemaContext, SchemaItemKey, SchemaKey, SchemaMatchType } from \"@itwin/ecschema-metadata\";\r\nimport { MutableSchema } from \"./Mutable/MutableSchema\";\r\nimport { assert } from \"@itwin/core-bentley\";\r\nimport { Constants } from \"./Constants\";\r\nimport { CustomAttributes } from \"./CustomAttributes\";\r\nimport { Entities } from \"./Entities\";\r\nimport { Enumerations } from \"./Enumerations\";\r\nimport { Formats } from \"./Formats\";\r\nimport { InvertedUnits } from \"./InvertedUnits\";\r\nimport { KindOfQuantities } from \"./KindOfQuantities\";\r\nimport { Mixins } from \"./Mixins\";\r\nimport { Phenomena } from \"./Phenomena\";\r\nimport { PropertyCategories } from \"./PropertyCategories\";\r\nimport { RelationshipClasses } from \"./RelationshipClasses\";\r\nimport { Structs } from \"./Structs\";\r\nimport { Units } from \"./Units\";\r\nimport { UnitSystems } from \"./UnitSystems\";\r\n\r\n// We can either add validation in Editor, or in the protected methods of Schema.\r\n// TODO: Add an error code so we can do something programmatic with the error.\r\n/**\r\n * @alpha\r\n */\r\nexport interface SchemaEditResults {\r\n schemaKey?: SchemaKey;\r\n errorMessage?: string;\r\n}\r\n\r\n/**\r\n * @alpha\r\n */\r\nexport interface SchemaItemEditResults {\r\n itemKey?: SchemaItemKey;\r\n errorMessage?: string;\r\n}\r\n\r\n/**\r\n * @alpha\r\n */\r\nexport interface PropertyEditResults {\r\n itemKey?: SchemaItemKey;\r\n propertyName?: string;\r\n errorMessage?: string;\r\n}\r\n\r\n/**\r\n * A class that allows you to edit and create schemas, classes, and items from the SchemaContext level.\r\n * @alpha\r\n */\r\nexport class SchemaContextEditor {\r\n private _schemaContext: SchemaContext;\r\n public readonly entities = new Entities(this);\r\n public readonly mixins = new Mixins(this);\r\n public readonly structs = new Structs(this);\r\n public readonly customAttributes = new CustomAttributes(this);\r\n public readonly relationships = new RelationshipClasses(this);\r\n public readonly constants = new Constants(this);\r\n public readonly enumerations = new Enumerations(this);\r\n public readonly formats = new Formats(this);\r\n public readonly kindOfQuantities = new KindOfQuantities(this);\r\n public readonly units = new Units(this);\r\n public readonly phenomenons = new Phenomena(this);\r\n public readonly unitSystems = new UnitSystems(this);\r\n public readonly propertyCategories = new PropertyCategories(this);\r\n public readonly invertedUnits = new InvertedUnits(this);\r\n\r\n /**\r\n * Creates a new SchemaContextEditor instance.\r\n * @param schemaContext The SchemaContext the Editor will use to edit in.\r\n */\r\n constructor(schemaContext: SchemaContext) {\r\n // TODO: Make copy\r\n this._schemaContext = schemaContext;\r\n }\r\n\r\n /** Allows you to get schema classes and items through regular SchemaContext methods. */\r\n public get schemaContext(): SchemaContext { return this._schemaContext; }\r\n\r\n public async finish(): Promise<SchemaContext> {\r\n return this._schemaContext;\r\n }\r\n\r\n /**\r\n * Helper method for retrieving a schema, previously added, from the SchemaContext.\r\n * @param schemaKey The SchemaKey identifying the schema.\r\n */\r\n public async getSchema(schemaKey: SchemaKey): Promise<MutableSchema> {\r\n const schema = (await this.schemaContext.getCachedSchema<MutableSchema>(schemaKey, SchemaMatchType.Latest));\r\n if (schema === undefined)\r\n throw new ECObjectsError(ECObjectsStatus.UnableToLocateSchema,`Schema Key ${schemaKey.toString(true)} not found in context`);\r\n\r\n return schema;\r\n }\r\n /**\r\n * Creates a Schema with the given properties and adds it to the current schema context.\r\n * @param name The name given to the new schema.\r\n * @param alias The alias of the new schema.\r\n * @param readVersion The read version number of the schema.\r\n * @param writeVersion The write version number of the schema.\r\n * @param minorVersion The minor version number of the schema.\r\n * @returns Resolves to a SchemaEditResults object.\r\n */\r\n public async createSchema(name: string, alias: string, readVersion: number, writeVersion: number, minorVersion: number): Promise<SchemaEditResults> {\r\n const newSchema = new Schema(this._schemaContext, name, alias, readVersion, writeVersion, minorVersion);\r\n await this._schemaContext.addSchema(newSchema);\r\n return { schemaKey: newSchema.schemaKey };\r\n }\r\n\r\n /**\r\n * Adds a referenced schema to the schema identified by the given SchemaKey.\r\n * @param schemaKey The SchemaKey identifying the schema.\r\n * @param refSchema The referenced schema to add.\r\n */\r\n public async addSchemaReference(schemaKey: SchemaKey, refSchema: Schema): Promise<SchemaEditResults> {\r\n const schema = (await this.schemaContext.getCachedSchema<MutableSchema>(schemaKey, SchemaMatchType.Exact));\r\n if (schema === undefined)\r\n return { errorMessage: `Schema Key ${schemaKey.toString(true)} not found in context` };\r\n\r\n await schema.addReference(refSchema);\r\n const diagnostics = Rules.validateSchemaReferences(schema);\r\n\r\n const result: SchemaEditResults = { errorMessage: \"\" };\r\n for await (const diagnostic of diagnostics) {\r\n result.errorMessage += `${diagnostic.code}: ${diagnostic.messageText}\\r\\n`;\r\n }\r\n\r\n if (result.errorMessage) {\r\n this.removeReference(schema, refSchema);\r\n return result;\r\n }\r\n\r\n if (!await this.schemaContext.getCachedSchema(refSchema.schemaKey)) {\r\n await this.schemaContext.addSchema(refSchema);\r\n }\r\n\r\n return {};\r\n }\r\n\r\n /**\r\n * Adds a CustomAttribute instance to the schema identified by the given SchemaKey\r\n * @param schemaKey The SchemaKey identifying the schema.\r\n * @param customAttribute The CustomAttribute instance to add.\r\n */\r\n public async addCustomAttribute(schemaKey: SchemaKey, customAttribute: CustomAttribute): Promise<SchemaEditResults> {\r\n const schema = (await this.schemaContext.getCachedSchema<MutableSchema>(schemaKey, SchemaMatchType.Latest));\r\n if (schema === undefined)\r\n return { errorMessage: `Schema Key ${schemaKey.toString(true)} not found in context` };\r\n\r\n schema.addCustomAttribute(customAttribute);\r\n\r\n const diagnostics = Rules.validateCustomAttributeInstance(schema, customAttribute);\r\n\r\n const result: SchemaEditResults = { errorMessage: \"\" };\r\n for await (const diagnostic of diagnostics) {\r\n result.errorMessage += `${diagnostic.code}: ${diagnostic.messageText}\\r\\n`;\r\n }\r\n\r\n if (result.errorMessage) {\r\n this.removeCustomAttribute(schema, customAttribute);\r\n return result;\r\n }\r\n\r\n return {};\r\n }\r\n\r\n /**\r\n * Sets the schema version.\r\n * @param schemaKey The SchemaKey identifying the schema.\r\n * @param readVersion The read version of the schema. If not specified, the existing read version will be maintained.\r\n * @param writeVersion The write version of the schema. If not specified, the existing write version will be maintained.\r\n * @param minorVersion The minor version of the schema. If not specified, the existing minor version will be maintained.\r\n */\r\n public async setVersion(schemaKey: SchemaKey, readVersion?: number, writeVersion?: number, minorVersion?: number): Promise<SchemaEditResults> {\r\n const schema = (await this.schemaContext.getCachedSchema(schemaKey, SchemaMatchType.Latest));\r\n if (schema === undefined)\r\n return { errorMessage: `Schema Key ${schemaKey.toString(true)} not found in context` };\r\n\r\n schema.setVersion(readVersion || schema.readVersion, writeVersion || schema.writeVersion, minorVersion || schema.minorVersion);\r\n return {};\r\n }\r\n\r\n /**\r\n * Increments the minor version of a schema.\r\n * @param schemaKey The SchemaKey identifying the schema.\r\n */\r\n public async incrementMinorVersion(schemaKey: SchemaKey): Promise<SchemaEditResults> {\r\n const schema = (await this.schemaContext.getCachedSchema(schemaKey, SchemaMatchType.Latest));\r\n if (schema === undefined)\r\n return { errorMessage: `Schema Key ${schemaKey.toString(true)} not found in context` };\r\n\r\n schema.setVersion(schema.readVersion, schema.writeVersion, schema.minorVersion + 1);\r\n return {};\r\n }\r\n\r\n private removeReference(schema: Schema, refSchema: Schema) {\r\n const index: number = schema.references.indexOf(refSchema);\r\n if (index !== -1) {\r\n schema.references.splice(index, 1);\r\n }\r\n }\r\n\r\n private removeCustomAttribute(schema: Schema, customAttribute: CustomAttribute) {\r\n assert(schema.customAttributes !== undefined);\r\n const map = schema.customAttributes as Map<string, CustomAttribute>;\r\n map.delete(customAttribute.className);\r\n }\r\n}\r\n\r\n"]}
|
|
1
|
+
{"version":3,"file":"Editor.js","sourceRoot":"","sources":["../../../src/Editing/Editor.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,+CAA+C;AAC/C,gEAA8J;AAE9J,sDAA6C;AAC7C,2CAAwC;AACxC,yDAAsD;AACtD,yCAAsC;AACtC,iDAA8C;AAC9C,uCAAoC;AACpC,mDAAgD;AAChD,yDAAsD;AACtD,qCAAkC;AAClC,2CAAwC;AACxC,6DAA0D;AAC1D,+DAA4D;AAC5D,uCAAoC;AACpC,mCAAgC;AAChC,+CAA4C;AAC5C,+CAA4C;AA6B5C;;;GAGG;AACH,MAAa,mBAAmB;IAoB9B;;;OAGG;IACH,YAAY,aAA4B;QAtBxB,aAAQ,GAAG,IAAI,m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K,SAAS,CAAC,CAAC;QAC9C,MAAM,GAAG,GAAG,MAAM,CAAC,gBAAgD,CAAC;QACpE,GAAG,CAAC,MAAM,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;IACxC,CAAC;CACF;AAhKD,kDAgKC","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 * as Rules from \"../Validation/ECRules\";\r\nimport { CustomAttribute, ECObjectsError, ECObjectsStatus, Schema, SchemaContext, SchemaItemKey, SchemaKey, SchemaMatchType } from \"@itwin/ecschema-metadata\";\r\nimport { MutableSchema } from \"./Mutable/MutableSchema\";\r\nimport { assert } from \"@itwin/core-bentley\";\r\nimport { Constants } from \"./Constants\";\r\nimport { CustomAttributes } from \"./CustomAttributes\";\r\nimport { Entities } from \"./Entities\";\r\nimport { Enumerations } from \"./Enumerations\";\r\nimport { Formats } from \"./Formats\";\r\nimport { InvertedUnits } from \"./InvertedUnits\";\r\nimport { KindOfQuantities } from \"./KindOfQuantities\";\r\nimport { Mixins } from \"./Mixins\";\r\nimport { Phenomena } from \"./Phenomena\";\r\nimport { PropertyCategories } from \"./PropertyCategories\";\r\nimport { RelationshipClasses } from \"./RelationshipClasses\";\r\nimport { Structs } from \"./Structs\";\r\nimport { Units } from \"./Units\";\r\nimport { UnitSystems } from \"./UnitSystems\";\r\nimport { SchemaItems } from \"./SchemaItems\";\r\n\r\n// We can either add validation in Editor, or in the protected methods of Schema.\r\n// TODO: Add an error code so we can do something programmatic with the error.\r\n/**\r\n * @alpha\r\n */\r\nexport interface SchemaEditResults {\r\n schemaKey?: SchemaKey;\r\n errorMessage?: string;\r\n}\r\n\r\n/**\r\n * @alpha\r\n */\r\nexport interface SchemaItemEditResults {\r\n itemKey?: SchemaItemKey;\r\n errorMessage?: string;\r\n}\r\n\r\n/**\r\n * @alpha\r\n */\r\nexport interface PropertyEditResults {\r\n itemKey?: SchemaItemKey;\r\n propertyName?: string;\r\n errorMessage?: string;\r\n}\r\n\r\n/**\r\n * A class that allows you to edit and create schemas, classes, and items from the SchemaContext level.\r\n * @alpha\r\n */\r\nexport class SchemaContextEditor {\r\n private _schemaContext: SchemaContext;\r\n public readonly entities = new Entities(this);\r\n public readonly mixins = new Mixins(this);\r\n public readonly structs = new Structs(this);\r\n public readonly customAttributes = new CustomAttributes(this);\r\n public readonly relationships = new RelationshipClasses(this);\r\n public readonly constants = new Constants(this);\r\n public readonly enumerations = new Enumerations(this);\r\n public readonly formats = new Formats(this);\r\n public readonly kindOfQuantities = new KindOfQuantities(this);\r\n public readonly units = new Units(this);\r\n public readonly phenomenons = new Phenomena(this);\r\n public readonly unitSystems = new UnitSystems(this);\r\n public readonly propertyCategories = new PropertyCategories(this);\r\n public readonly invertedUnits = new InvertedUnits(this);\r\n\r\n /** @internal */\r\n public readonly schemaItems = new SchemaItems(this);\r\n\r\n /**\r\n * Creates a new SchemaContextEditor instance.\r\n * @param schemaContext The SchemaContext the Editor will use to edit in.\r\n */\r\n constructor(schemaContext: SchemaContext) {\r\n // TODO: Make copy\r\n this._schemaContext = schemaContext;\r\n }\r\n\r\n /** Allows you to get schema classes and items through regular SchemaContext methods. */\r\n public get schemaContext(): SchemaContext { return this._schemaContext; }\r\n\r\n public async finish(): Promise<SchemaContext> {\r\n return this._schemaContext;\r\n }\r\n\r\n /**\r\n * Helper method for retrieving a schema, previously added, from the SchemaContext.\r\n * @param schemaKey The SchemaKey identifying the schema.\r\n */\r\n public async getSchema(schemaKey: SchemaKey): Promise<MutableSchema> {\r\n const schema = (await this.schemaContext.getCachedSchema<MutableSchema>(schemaKey, SchemaMatchType.Latest));\r\n if (schema === undefined)\r\n throw new ECObjectsError(ECObjectsStatus.UnableToLocateSchema,`Schema Key ${schemaKey.toString(true)} not found in context`);\r\n\r\n return schema;\r\n }\r\n /**\r\n * Creates a Schema with the given properties and adds it to the current schema context.\r\n * @param name The name given to the new schema.\r\n * @param alias The alias of the new schema.\r\n * @param readVersion The read version number of the schema.\r\n * @param writeVersion The write version number of the schema.\r\n * @param minorVersion The minor version number of the schema.\r\n * @returns Resolves to a SchemaEditResults object.\r\n */\r\n public async createSchema(name: string, alias: string, readVersion: number, writeVersion: number, minorVersion: number): Promise<SchemaEditResults> {\r\n const newSchema = new Schema(this._schemaContext, name, alias, readVersion, writeVersion, minorVersion);\r\n await this._schemaContext.addSchema(newSchema);\r\n return { schemaKey: newSchema.schemaKey };\r\n }\r\n\r\n /**\r\n * Adds a referenced schema to the schema identified by the given SchemaKey.\r\n * @param schemaKey The SchemaKey identifying the schema.\r\n * @param refSchema The referenced schema to add.\r\n */\r\n public async addSchemaReference(schemaKey: SchemaKey, refSchema: Schema): Promise<SchemaEditResults> {\r\n const schema = (await this.schemaContext.getCachedSchema<MutableSchema>(schemaKey, SchemaMatchType.Exact));\r\n if (schema === undefined)\r\n return { errorMessage: `Schema Key ${schemaKey.toString(true)} not found in context` };\r\n\r\n await schema.addReference(refSchema);\r\n const diagnostics = Rules.validateSchemaReferences(schema);\r\n\r\n const result: SchemaEditResults = { errorMessage: \"\" };\r\n for await (const diagnostic of diagnostics) {\r\n result.errorMessage += `${diagnostic.code}: ${diagnostic.messageText}\\r\\n`;\r\n }\r\n\r\n if (result.errorMessage) {\r\n this.removeReference(schema, refSchema);\r\n return result;\r\n }\r\n\r\n if (!await this.schemaContext.getCachedSchema(refSchema.schemaKey)) {\r\n await this.schemaContext.addSchema(refSchema);\r\n }\r\n\r\n return {};\r\n }\r\n\r\n /**\r\n * Adds a CustomAttribute instance to the schema identified by the given SchemaKey\r\n * @param schemaKey The SchemaKey identifying the schema.\r\n * @param customAttribute The CustomAttribute instance to add.\r\n */\r\n public async addCustomAttribute(schemaKey: SchemaKey, customAttribute: CustomAttribute): Promise<SchemaEditResults> {\r\n const schema = (await this.schemaContext.getCachedSchema<MutableSchema>(schemaKey, SchemaMatchType.Latest));\r\n if (schema === undefined)\r\n return { errorMessage: `Schema Key ${schemaKey.toString(true)} not found in context` };\r\n\r\n schema.addCustomAttribute(customAttribute);\r\n\r\n const diagnostics = Rules.validateCustomAttributeInstance(schema, customAttribute);\r\n\r\n const result: SchemaEditResults = { errorMessage: \"\" };\r\n for await (const diagnostic of diagnostics) {\r\n result.errorMessage += `${diagnostic.code}: ${diagnostic.messageText}\\r\\n`;\r\n }\r\n\r\n if (result.errorMessage) {\r\n this.removeCustomAttribute(schema, customAttribute);\r\n return result;\r\n }\r\n\r\n return {};\r\n }\r\n\r\n /**\r\n * Sets the schema version.\r\n * @param schemaKey The SchemaKey identifying the schema.\r\n * @param readVersion The read version of the schema. If not specified, the existing read version will be maintained.\r\n * @param writeVersion The write version of the schema. If not specified, the existing write version will be maintained.\r\n * @param minorVersion The minor version of the schema. If not specified, the existing minor version will be maintained.\r\n */\r\n public async setVersion(schemaKey: SchemaKey, readVersion?: number, writeVersion?: number, minorVersion?: number): Promise<SchemaEditResults> {\r\n const schema = (await this.schemaContext.getCachedSchema(schemaKey, SchemaMatchType.Latest));\r\n if (schema === undefined)\r\n return { errorMessage: `Schema Key ${schemaKey.toString(true)} not found in context` };\r\n\r\n schema.setVersion(readVersion || schema.readVersion, writeVersion || schema.writeVersion, minorVersion || schema.minorVersion);\r\n return {};\r\n }\r\n\r\n /**\r\n * Increments the minor version of a schema.\r\n * @param schemaKey The SchemaKey identifying the schema.\r\n */\r\n public async incrementMinorVersion(schemaKey: SchemaKey): Promise<SchemaEditResults> {\r\n const schema = (await this.schemaContext.getCachedSchema(schemaKey, SchemaMatchType.Latest));\r\n if (schema === undefined)\r\n return { errorMessage: `Schema Key ${schemaKey.toString(true)} not found in context` };\r\n\r\n schema.setVersion(schema.readVersion, schema.writeVersion, schema.minorVersion + 1);\r\n return {};\r\n }\r\n\r\n private removeReference(schema: Schema, refSchema: Schema) {\r\n const index: number = schema.references.indexOf(refSchema);\r\n if (index !== -1) {\r\n schema.references.splice(index, 1);\r\n }\r\n }\r\n\r\n private removeCustomAttribute(schema: Schema, customAttribute: CustomAttribute) {\r\n assert(schema.customAttributes !== undefined);\r\n const map = schema.customAttributes as Map<string, CustomAttribute>;\r\n map.delete(customAttribute.className);\r\n }\r\n}\r\n\r\n"]}
|
|
@@ -18,5 +18,7 @@ export declare class Enumerations {
|
|
|
18
18
|
*/
|
|
19
19
|
createFromProps(schemaKey: SchemaKey, enumProps: EnumerationProps): Promise<SchemaItemEditResults>;
|
|
20
20
|
addEnumerator(enumerationKey: SchemaItemKey, enumerator: AnyEnumerator): Promise<void>;
|
|
21
|
+
setEnumeratorLabel(enumerationKey: SchemaItemKey, enumeratorName: string, label: string | undefined): Promise<void>;
|
|
22
|
+
setEnumeratorDescription(enumerationKey: SchemaItemKey, enumeratorName: string, description: string | undefined): Promise<void>;
|
|
21
23
|
}
|
|
22
24
|
//# sourceMappingURL=Enumerations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Enumerations.d.ts","sourceRoot":"","sources":["../../../src/Editing/Enumerations.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAgD,gBAAgB,EAAE,aAAa,EAAE,aAAa,EAAkB,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAClL,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"Enumerations.d.ts","sourceRoot":"","sources":["../../../src/Editing/Enumerations.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAgD,gBAAgB,EAAE,aAAa,EAAE,aAAa,EAAkB,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAClL,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAOtE;;;GAGG;AACH,qBAAa,YAAY;IACJ,SAAS,CAAC,aAAa,EAAE,mBAAmB;gBAAlC,aAAa,EAAE,mBAAmB;IAElD,MAAM,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,CAAC,OAAO,GAAG,aAAa,CAAC,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAsBrN;;;;OAIG;IACU,eAAe,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,gBAAgB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAgBlG,aAAa,CAAC,cAAc,EAAE,aAAa,EAAE,UAAU,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAkBtF,kBAAkB,CAAC,cAAc,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IAgBnH,wBAAwB,CAAC,cAAc,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;CAe7I"}
|
|
@@ -62,6 +62,28 @@ class Enumerations {
|
|
|
62
62
|
throw new ecschema_metadata_1.ECObjectsError(ecschema_metadata_1.ECObjectsStatus.InvalidPrimitiveType, `The Enumeration ${enumeration.name} has type string, while ${enumerator.name} has type ${typeof (enumerator.value)}.`);
|
|
63
63
|
enumeration.addEnumerator(enumerator);
|
|
64
64
|
}
|
|
65
|
+
async setEnumeratorLabel(enumerationKey, enumeratorName, label) {
|
|
66
|
+
const enumeration = (await this._schemaEditor.schemaContext.getSchemaItem(enumerationKey));
|
|
67
|
+
if (enumeration === undefined)
|
|
68
|
+
throw new ecschema_metadata_1.ECObjectsError(ecschema_metadata_1.ECObjectsStatus.ClassNotFound, `Unable to locate Enumeration class ${enumerationKey.fullName}.`);
|
|
69
|
+
if (enumeration.schemaItemType !== ecschema_metadata_1.SchemaItemType.Enumeration)
|
|
70
|
+
throw new ecschema_metadata_1.ECObjectsError(ecschema_metadata_1.ECObjectsStatus.InvalidType, `${enumeration.fullName} is not of type Enumerator class.`);
|
|
71
|
+
const enumerator = enumeration.getEnumeratorByName(enumeratorName);
|
|
72
|
+
if (enumerator === undefined)
|
|
73
|
+
throw new ecschema_metadata_1.ECObjectsError(ecschema_metadata_1.ECObjectsStatus.ClassNotFound, `Enumerator ${enumeratorName} does not exists in Enumeration ${enumeration.fullName}.`);
|
|
74
|
+
enumerator.label = label;
|
|
75
|
+
}
|
|
76
|
+
async setEnumeratorDescription(enumerationKey, enumeratorName, description) {
|
|
77
|
+
const enumeration = (await this._schemaEditor.schemaContext.getSchemaItem(enumerationKey));
|
|
78
|
+
if (enumeration === undefined)
|
|
79
|
+
throw new ecschema_metadata_1.ECObjectsError(ecschema_metadata_1.ECObjectsStatus.ClassNotFound, `Unable to locate Enumeration class ${enumerationKey.fullName}.`);
|
|
80
|
+
if (enumeration.schemaItemType !== ecschema_metadata_1.SchemaItemType.Enumeration)
|
|
81
|
+
throw new ecschema_metadata_1.ECObjectsError(ecschema_metadata_1.ECObjectsStatus.InvalidType, `${enumeration.fullName} is not of type Enumerator class.`);
|
|
82
|
+
const enumerator = enumeration.getEnumeratorByName(enumeratorName);
|
|
83
|
+
if (enumerator === undefined)
|
|
84
|
+
throw new ecschema_metadata_1.ECObjectsError(ecschema_metadata_1.ECObjectsStatus.ClassNotFound, `Enumerator ${enumeratorName} does not exists in Enumeration ${enumeration.fullName}.`);
|
|
85
|
+
enumerator.description = description;
|
|
86
|
+
}
|
|
65
87
|
}
|
|
66
88
|
exports.Enumerations = Enumerations;
|
|
67
89
|
//# sourceMappingURL=Enumerations.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Enumerations.js","sourceRoot":"","sources":["../../../src/Editing/Enumerations.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC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AAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAE1L,IAAI,WAAW,CAAC,QAAQ,IAAI,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,QAAQ;YAChE,MAAM,IAAI,kCAAc,CAAC,mCAAe,CAAC,oBAAoB,EAAE,mBAAmB,WAAW,CAAC,IAAI,2BAA2B,UAAU,CAAC,IAAI,aAAa,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAExL,WAAkC,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IAChE,CAAC;CACF;AA/DD,oCA+DC","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 { AnyEnumerator, ECObjectsError, ECObjectsStatus, Enumeration, EnumerationProps, PrimitiveType, SchemaItemKey, SchemaItemType, SchemaKey } from \"@itwin/ecschema-metadata\";\r\nimport { SchemaContextEditor, SchemaItemEditResults } from \"./Editor\";\r\nimport { MutableEnumeration } from \"./Mutable/MutableEnumeration\";\r\n\r\n/**\r\n * @alpha\r\n * A class allowing you to create schema items of type Enumeration.\r\n */\r\nexport class Enumerations {\r\n public constructor(protected _schemaEditor: SchemaContextEditor) { }\r\n\r\n public async create(schemaKey: SchemaKey, name: string, type: PrimitiveType.Integer | PrimitiveType.String, displayLabel?: string, isStrict?: boolean, enumerators?: AnyEnumerator[]): Promise<SchemaItemEditResults> {\r\n const schema = await this._schemaEditor.getSchema(schemaKey);\r\n if (schema === undefined)\r\n return { errorMessage: `Schema Key ${schemaKey.toString(true)} not found in context` };\r\n\r\n const newEnum = (await schema.createEnumeration(name, type));\r\n if (newEnum === undefined)\r\n return { errorMessage: `Failed to create class ${name} in schema ${schemaKey.toString(true)}.` };\r\n\r\n if (undefined !== isStrict)\r\n (newEnum as MutableEnumeration).setIsStrict(isStrict);\r\n\r\n if (undefined !== enumerators)\r\n for (const enumerator of enumerators)\r\n await this.addEnumerator(newEnum.key, enumerator);\r\n\r\n if (displayLabel)\r\n (newEnum as MutableEnumeration).setDisplayLabel(displayLabel);\r\n\r\n return { itemKey: newEnum.key };\r\n }\r\n\r\n /**\r\n * Creates an Enumeration through an EnumeratorProps.\r\n * @param schemaKey a SchemaKey of the Schema that will house the new object.\r\n * @param relationshipProps a json object that will be used to populate the new RelationshipClass. Needs a name value passed in.\r\n */\r\n public async createFromProps(schemaKey: SchemaKey, enumProps: EnumerationProps): Promise<SchemaItemEditResults> {\r\n const schema = await this._schemaEditor.getSchema(schemaKey);\r\n if (schema === undefined)\r\n return { errorMessage: `Schema Key ${schemaKey.toString(true)} not found in context` };\r\n\r\n if (enumProps.name === undefined)\r\n return { errorMessage: `No name was supplied within props.` };\r\n\r\n const newEnum = (await schema.createEnumeration(enumProps.name));\r\n if (newEnum === undefined)\r\n return { errorMessage: `Failed to create class ${enumProps.name} in schema ${schemaKey.toString(true)}.` };\r\n\r\n await newEnum.fromJSON(enumProps);\r\n return { itemKey: newEnum.key };\r\n }\r\n\r\n public async addEnumerator(enumerationKey: SchemaItemKey, enumerator: AnyEnumerator): Promise<void> {\r\n const enumeration = (await this._schemaEditor.schemaContext.getSchemaItem<Enumeration>(enumerationKey));\r\n\r\n if (enumeration === undefined)\r\n throw new ECObjectsError(ECObjectsStatus.ClassNotFound, `Unable to locate Enumeration class ${enumerationKey.fullName}.`);\r\n\r\n if (enumeration.schemaItemType !== SchemaItemType.Enumeration)\r\n throw new ECObjectsError(ECObjectsStatus.InvalidType, `${enumeration.fullName} is not of type Enumerator class.`);\r\n\r\n if (enumeration.isInt && typeof (enumerator.value) !== \"number\")\r\n throw new ECObjectsError(ECObjectsStatus.InvalidPrimitiveType, `The Enumeration ${enumeration.name} has type integer, while ${enumerator.name} has type ${typeof (enumerator.value)}.`);\r\n\r\n if (enumeration.isString && typeof (enumerator.value) !== \"string\")\r\n throw new ECObjectsError(ECObjectsStatus.InvalidPrimitiveType, `The Enumeration ${enumeration.name} has type string, while ${enumerator.name} has type ${typeof (enumerator.value)}.`);\r\n\r\n (enumeration as MutableEnumeration).addEnumerator(enumerator);\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"Enumerations.js","sourceRoot":"","sources":["../../../src/Editing/Enumerations.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,gEAAkL;AAQlL;;;GAGG;AACH,MAAa,YAAY;IACvB,YAA6B,aAAkC;QAAlC,kBAAa,GAAb,aAAa,CAAqB;IAAI,CAAC;IAE7D,KAAK,CAAC,MAAM,CAAC,SAAoB,EAAE,IAAY,EAAE,IAAkD,EAAE,YAAqB,EAAE,QAAkB,EAAE,WAA6B;QAClL,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,OAAO,GAAG,CAAC,MAAM,MAAM,CAAC,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;QAC7D,IAAI,OAAO,KAAK,SAAS;YACvB,OAAO,EAAE,YAAY,EAAE,0BAA0B,IAAI,cAAc,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;QAEnG,IAAI,SAAS,KAAK,QAAQ;YACvB,OAA8B,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QAExD,IAAI,SAAS,KAAK,WAAW;YAC3B,KAAK,MAAM,UAAU,IAAI,WAAW;gBAClC,MAAM,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;QAEtD,IAAI,YAAY;YACb,OAA8B,CAAC,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,IAAI,kCAAc,CAAC,mCAAe,CAAC,aAAa,EAAE,cAAc,cAAc,mCAAmC,WAAW,CAAC,QAAQ,GAAG,CAAC,CAAC;QAEjJ,UAAgC,CAAC,KAAK,GAAG,KAAK,CAAC;IAClD,CAAC;IAEM,KAAK,CAAC,wBAAwB,CAAC,cAA6B,EAAE,cAAsB,EAAE,WAA+B;QAC1H,MAAM,WAAW,GAAG,CAAC,MAAM,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,aAAa,CAAc,cAAc,CAAC,CAAC,CAAC;QAExG,IAAI,WAAW,KAAK,SAAS;YAC3B,MAAM,IAAI,kCAAc,CAAC,mCAAe,CAAC,aAAa,EAAE,sCAAsC,cAAc,CAAC,QAAQ,GAAG,CAAC,CAAC;QAE5H,IAAI,WAAW,CAAC,cAAc,KAAK,kCAAc,CAAC,WAAW;YAC3D,MAAM,IAAI,kCAAc,CAAC,mCAAe,CAAC,WAAW,EAAE,GAAG,WAAW,CAAC,QAAQ,mCAAmC,CAAC,CAAC;QAEpH,MAAM,UAAU,GAAG,WAAW,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAC;QACnE,IAAI,UAAU,KAAK,SAAS;YAC1B,MAAM,IAAI,kCAAc,CAAC,mCAAe,CAAC,aAAa,EAAE,cAAc,cAAc,mCAAmC,WAAW,CAAC,QAAQ,GAAG,CAAC,CAAC;QAEjJ,UAAgC,CAAC,WAAW,GAAG,WAAW,CAAC;IAC9D,CAAC;CACF;AA/FD,oCA+FC","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 { AnyEnumerator, ECObjectsError, ECObjectsStatus, Enumeration, EnumerationProps, PrimitiveType, SchemaItemKey, SchemaItemType, SchemaKey } from \"@itwin/ecschema-metadata\";\r\nimport { SchemaContextEditor, SchemaItemEditResults } from \"./Editor\";\r\nimport { MutableEnumeration } from \"./Mutable/MutableEnumeration\";\r\n\r\ntype MutableEnumerator = {\r\n -readonly [P in keyof AnyEnumerator]: AnyEnumerator[P]\r\n};\r\n\r\n/**\r\n * @alpha\r\n * A class allowing you to create schema items of type Enumeration.\r\n */\r\nexport class Enumerations {\r\n public constructor(protected _schemaEditor: SchemaContextEditor) { }\r\n\r\n public async create(schemaKey: SchemaKey, name: string, type: PrimitiveType.Integer | PrimitiveType.String, displayLabel?: string, isStrict?: boolean, enumerators?: AnyEnumerator[]): Promise<SchemaItemEditResults> {\r\n const schema = await this._schemaEditor.getSchema(schemaKey);\r\n if (schema === undefined)\r\n return { errorMessage: `Schema Key ${schemaKey.toString(true)} not found in context` };\r\n\r\n const newEnum = (await schema.createEnumeration(name, type));\r\n if (newEnum === undefined)\r\n return { errorMessage: `Failed to create class ${name} in schema ${schemaKey.toString(true)}.` };\r\n\r\n if (undefined !== isStrict)\r\n (newEnum as MutableEnumeration).setIsStrict(isStrict);\r\n\r\n if (undefined !== enumerators)\r\n for (const enumerator of enumerators)\r\n await this.addEnumerator(newEnum.key, enumerator);\r\n\r\n if (displayLabel)\r\n (newEnum as MutableEnumeration).setDisplayLabel(displayLabel);\r\n\r\n return { itemKey: newEnum.key };\r\n }\r\n\r\n /**\r\n * Creates an Enumeration through an EnumeratorProps.\r\n * @param schemaKey a SchemaKey of the Schema that will house the new object.\r\n * @param relationshipProps a json object that will be used to populate the new RelationshipClass. Needs a name value passed in.\r\n */\r\n public async createFromProps(schemaKey: SchemaKey, enumProps: EnumerationProps): Promise<SchemaItemEditResults> {\r\n const schema = await this._schemaEditor.getSchema(schemaKey);\r\n if (schema === undefined)\r\n return { errorMessage: `Schema Key ${schemaKey.toString(true)} not found in context` };\r\n\r\n if (enumProps.name === undefined)\r\n return { errorMessage: `No name was supplied within props.` };\r\n\r\n const newEnum = (await schema.createEnumeration(enumProps.name));\r\n if (newEnum === undefined)\r\n return { errorMessage: `Failed to create class ${enumProps.name} in schema ${schemaKey.toString(true)}.` };\r\n\r\n await newEnum.fromJSON(enumProps);\r\n return { itemKey: newEnum.key };\r\n }\r\n\r\n public async addEnumerator(enumerationKey: SchemaItemKey, enumerator: AnyEnumerator): Promise<void> {\r\n const enumeration = (await this._schemaEditor.schemaContext.getSchemaItem<Enumeration>(enumerationKey));\r\n\r\n if (enumeration === undefined)\r\n throw new ECObjectsError(ECObjectsStatus.ClassNotFound, `Unable to locate Enumeration class ${enumerationKey.fullName}.`);\r\n\r\n if (enumeration.schemaItemType !== SchemaItemType.Enumeration)\r\n throw new ECObjectsError(ECObjectsStatus.InvalidType, `${enumeration.fullName} is not of type Enumerator class.`);\r\n\r\n if (enumeration.isInt && typeof (enumerator.value) !== \"number\")\r\n throw new ECObjectsError(ECObjectsStatus.InvalidPrimitiveType, `The Enumeration ${enumeration.name} has type integer, while ${enumerator.name} has type ${typeof (enumerator.value)}.`);\r\n\r\n if (enumeration.isString && typeof (enumerator.value) !== \"string\")\r\n throw new ECObjectsError(ECObjectsStatus.InvalidPrimitiveType, `The Enumeration ${enumeration.name} has type string, while ${enumerator.name} has type ${typeof (enumerator.value)}.`);\r\n\r\n (enumeration as MutableEnumeration).addEnumerator(enumerator);\r\n }\r\n\r\n public async setEnumeratorLabel(enumerationKey: SchemaItemKey, enumeratorName: string, label: string | undefined): Promise<void> {\r\n const enumeration = (await this._schemaEditor.schemaContext.getSchemaItem<Enumeration>(enumerationKey));\r\n\r\n if (enumeration === undefined)\r\n throw new ECObjectsError(ECObjectsStatus.ClassNotFound, `Unable to locate Enumeration class ${enumerationKey.fullName}.`);\r\n\r\n if (enumeration.schemaItemType !== SchemaItemType.Enumeration)\r\n throw new ECObjectsError(ECObjectsStatus.InvalidType, `${enumeration.fullName} is not of type Enumerator class.`);\r\n\r\n const enumerator = enumeration.getEnumeratorByName(enumeratorName);\r\n if (enumerator === undefined)\r\n throw new ECObjectsError(ECObjectsStatus.ClassNotFound, `Enumerator ${enumeratorName} does not exists in Enumeration ${enumeration.fullName}.`);\r\n\r\n (enumerator as MutableEnumerator).label = label;\r\n }\r\n\r\n public async setEnumeratorDescription(enumerationKey: SchemaItemKey, enumeratorName: string, description: string | undefined): Promise<void> {\r\n const enumeration = (await this._schemaEditor.schemaContext.getSchemaItem<Enumeration>(enumerationKey));\r\n\r\n if (enumeration === undefined)\r\n throw new ECObjectsError(ECObjectsStatus.ClassNotFound, `Unable to locate Enumeration class ${enumerationKey.fullName}.`);\r\n\r\n if (enumeration.schemaItemType !== SchemaItemType.Enumeration)\r\n throw new ECObjectsError(ECObjectsStatus.InvalidType, `${enumeration.fullName} is not of type Enumerator class.`);\r\n\r\n const enumerator = enumeration.getEnumeratorByName(enumeratorName);\r\n if (enumerator === undefined)\r\n throw new ECObjectsError(ECObjectsStatus.ClassNotFound, `Enumerator ${enumeratorName} does not exists in Enumeration ${enumeration.fullName}.`);\r\n\r\n (enumerator as MutableEnumerator).description = description;\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Editing
|
|
3
|
+
*/
|
|
4
|
+
import { SchemaItemKey, SchemaItemProps } from "@itwin/ecschema-metadata";
|
|
5
|
+
import { SchemaContextEditor } from "./Editor";
|
|
6
|
+
/**
|
|
7
|
+
* @internal
|
|
8
|
+
* A class allowing you to edit the schema item base class.
|
|
9
|
+
*/
|
|
10
|
+
export declare class SchemaItems {
|
|
11
|
+
protected _schemaEditor: SchemaContextEditor;
|
|
12
|
+
constructor(_schemaEditor: SchemaContextEditor);
|
|
13
|
+
applyProps(schemaItemKey: SchemaItemKey, schemItemProps: SchemaItemProps): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=SchemaItems.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SchemaItems.d.ts","sourceRoot":"","sources":["../../../src/Editing/SchemaItems.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAmC,aAAa,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3G,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C;;;GAGG;AACH,qBAAa,WAAW;IACH,SAAS,CAAC,aAAa,EAAE,mBAAmB;gBAAlC,aAAa,EAAE,mBAAmB;IAClD,UAAU,CAAC,aAAa,EAAE,aAAa,EAAE,cAAc,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;CAQtG"}
|
|
@@ -0,0 +1,28 @@
|
|
|
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.SchemaItems = void 0;
|
|
11
|
+
const ecschema_metadata_1 = require("@itwin/ecschema-metadata");
|
|
12
|
+
/**
|
|
13
|
+
* @internal
|
|
14
|
+
* A class allowing you to edit the schema item base class.
|
|
15
|
+
*/
|
|
16
|
+
class SchemaItems {
|
|
17
|
+
constructor(_schemaEditor) {
|
|
18
|
+
this._schemaEditor = _schemaEditor;
|
|
19
|
+
}
|
|
20
|
+
async applyProps(schemaItemKey, schemItemProps) {
|
|
21
|
+
const schemaItem = await this._schemaEditor.schemaContext.getSchemaItem(schemaItemKey);
|
|
22
|
+
if (schemaItem === undefined)
|
|
23
|
+
throw new ecschema_metadata_1.ECObjectsError(ecschema_metadata_1.ECObjectsStatus.ClassNotFound, `Schema Item ${schemaItemKey.fullName} not found in schema context.`);
|
|
24
|
+
await schemaItem.fromJSON(schemItemProps);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.SchemaItems = SchemaItems;
|
|
28
|
+
//# sourceMappingURL=SchemaItems.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SchemaItems.js","sourceRoot":"","sources":["../../../src/Editing/SchemaItems.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,gEAA2G;AAG3G;;;GAGG;AACH,MAAa,WAAW;IACtB,YAA6B,aAAkC;QAAlC,kBAAa,GAAb,aAAa,CAAqB;IAAI,CAAC;IAC7D,KAAK,CAAC,UAAU,CAAC,aAA4B,EAAE,cAA+B;QACnF,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC;QAEvF,IAAI,UAAU,KAAK,SAAS;YAC1B,MAAM,IAAI,kCAAc,CAAC,mCAAe,CAAC,aAAa,EAAE,eAAe,aAAa,CAAC,QAAQ,+BAA+B,CAAC,CAAC;QAEhI,MAAM,UAAU,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;IAC5C,CAAC;CACF;AAVD,kCAUC","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 { ECObjectsError, ECObjectsStatus, SchemaItemKey, SchemaItemProps } from \"@itwin/ecschema-metadata\";\r\nimport { SchemaContextEditor } from \"./Editor\";\r\n\r\n/**\r\n * @internal\r\n * A class allowing you to edit the schema item base class.\r\n */\r\nexport class SchemaItems {\r\n public constructor(protected _schemaEditor: SchemaContextEditor) { }\r\n public async applyProps(schemaItemKey: SchemaItemKey, schemItemProps: SchemaItemProps): Promise<void> {\r\n const schemaItem = await this._schemaEditor.schemaContext.getSchemaItem(schemaItemKey);\r\n\r\n if (schemaItem === undefined)\r\n throw new ECObjectsError(ECObjectsStatus.ClassNotFound, `Schema Item ${schemaItemKey.fullName} not found in schema context.`);\r\n\r\n await schemaItem.fromJSON(schemItemProps);\r\n }\r\n}\r\n"]}
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { CustomAttributeClass } from "@itwin/ecschema-metadata";
|
|
2
|
-
import {
|
|
2
|
+
import { PropertyValueResolver } from "./SchemaItemMerger";
|
|
3
|
+
import ClassMerger from "./ClassMerger";
|
|
3
4
|
/**
|
|
4
5
|
* @internal
|
|
5
6
|
*/
|
|
6
|
-
export default
|
|
7
|
+
export default class CAClassMerger extends ClassMerger {
|
|
8
|
+
/**
|
|
9
|
+
* Creates the property value resolver for [[CustomAttributeClass]] items.
|
|
10
|
+
*/
|
|
11
|
+
protected createPropertyValueResolver(): Promise<PropertyValueResolver<CustomAttributeClass>>;
|
|
12
|
+
}
|
|
7
13
|
//# sourceMappingURL=CAClassMerger.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CAClassMerger.d.ts","sourceRoot":"","sources":["../../../src/Merging/CAClassMerger.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,oBAAoB,
|
|
1
|
+
{"version":3,"file":"CAClassMerger.d.ts","sourceRoot":"","sources":["../../../src/Merging/CAClassMerger.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,WAAW,MAAM,eAAe,CAAC;AAExC;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,WAAW;IACpD;;OAEG;cACsB,2BAA2B,IAAI,OAAO,CAAC,qBAAqB,CAAC,oBAAoB,CAAC,CAAC;CAO7G"}
|
|
@@ -1,28 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
/*---------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
5
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
6
|
-
*--------------------------------------------------------------------------------------------*/
|
|
7
|
-
const ecschema_metadata_1 = require("@itwin/ecschema-metadata");
|
|
8
|
-
const SchemaItemMerger_1 = require("./SchemaItemMerger");
|
|
9
3
|
const ClassMerger_1 = require("./ClassMerger");
|
|
10
4
|
/**
|
|
11
5
|
* @internal
|
|
12
6
|
*/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
});
|
|
25
|
-
return (0, ClassMerger_1.default)(target, source, changes);
|
|
7
|
+
class CAClassMerger extends ClassMerger_1.default {
|
|
8
|
+
/**
|
|
9
|
+
* Creates the property value resolver for [[CustomAttributeClass]] items.
|
|
10
|
+
*/
|
|
11
|
+
async createPropertyValueResolver() {
|
|
12
|
+
return {
|
|
13
|
+
// TODO: The other container types should be added instead of overriding the existing flags.
|
|
14
|
+
// See issue: https://github.com/iTwin/itwinjs-core/issues/6014
|
|
15
|
+
appliesTo: (value) => value,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
26
18
|
}
|
|
27
|
-
exports.default =
|
|
19
|
+
exports.default = CAClassMerger;
|
|
28
20
|
//# sourceMappingURL=CAClassMerger.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CAClassMerger.js","sourceRoot":"","sources":["../../../src/Merging/CAClassMerger.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"CAClassMerger.js","sourceRoot":"","sources":["../../../src/Merging/CAClassMerger.ts"],"names":[],"mappings":";;AAMA,+CAAwC;AAExC;;GAEG;AACH,MAAqB,aAAc,SAAQ,qBAAW;IACpD;;OAEG;IACgB,KAAK,CAAC,2BAA2B;QAClD,OAAO;YACL,4FAA4F;YAC5F,qEAAqE;YACrE,SAAS,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,KAAK;SACpC,CAAC;IACJ,CAAC;CACF;AAXD,gCAWC","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 } from \"@itwin/ecschema-metadata\";\r\nimport { PropertyValueResolver } from \"./SchemaItemMerger\";\r\nimport ClassMerger from \"./ClassMerger\";\r\n\r\n/**\r\n * @internal\r\n */\r\nexport default class CAClassMerger extends ClassMerger {\r\n /**\r\n * Creates the property value resolver for [[CustomAttributeClass]] items.\r\n */\r\n protected override async createPropertyValueResolver(): Promise<PropertyValueResolver<CustomAttributeClass>> {\r\n return {\r\n // TODO: The other container types should be added instead of overriding the existing flags.\r\n // See issue: https://github.com/iTwin/itwinjs-core/issues/6014\r\n appliesTo: (value: number) => value,\r\n };\r\n }\r\n}\r\n"]}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import { ECClass } from "@itwin/ecschema-metadata";
|
|
1
|
+
import { ECClass, SchemaItemKey } from "@itwin/ecschema-metadata";
|
|
2
2
|
import { ClassChanges } from "../Validation/SchemaChanges";
|
|
3
|
+
import { SchemaItemMerger } from "./SchemaItemMerger";
|
|
3
4
|
/**
|
|
4
5
|
* @internal
|
|
5
6
|
*/
|
|
6
|
-
export default
|
|
7
|
+
export default class ClassMerger extends SchemaItemMerger<ECClass> {
|
|
8
|
+
protected merge(itemKey: SchemaItemKey, source: ECClass, change: ClassChanges): Promise<void>;
|
|
9
|
+
private mergeBaseClasses;
|
|
10
|
+
private mergeProperties;
|
|
11
|
+
}
|
|
7
12
|
//# sourceMappingURL=ClassMerger.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClassMerger.d.ts","sourceRoot":"","sources":["../../../src/Merging/ClassMerger.ts"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"ClassMerger.d.ts","sourceRoot":"","sources":["../../../src/Merging/ClassMerger.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAA8B,YAAY,EAAmB,MAAM,6BAA6B,CAAC;AACxG,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,gBAAgB,CAAC,OAAO,CAAC;cAEvC,KAAK,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY;YAU9E,gBAAgB;YAgBhB,eAAe;CAmB9B"}
|
|
@@ -1,59 +1,55 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
/*---------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
5
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
6
|
-
*--------------------------------------------------------------------------------------------*/
|
|
3
|
+
// /*---------------------------------------------------------------------------------------------
|
|
4
|
+
// * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
5
|
+
// * See LICENSE.md in the project root for license terms and full copyright notice.
|
|
6
|
+
// *--------------------------------------------------------------------------------------------*/
|
|
7
7
|
const ecschema_metadata_1 = require("@itwin/ecschema-metadata");
|
|
8
8
|
const SchemaChanges_1 = require("../Validation/SchemaChanges");
|
|
9
|
+
const SchemaItemMerger_1 = require("./SchemaItemMerger");
|
|
9
10
|
/**
|
|
10
11
|
* @internal
|
|
11
12
|
*/
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
exports.default = mergeClasses;
|
|
21
|
-
async function mergeBaseClass(target, source, baseClassChange) {
|
|
22
|
-
if (baseClassChange !== undefined) {
|
|
23
|
-
const sourceBaseClass = baseClassChange.diagnostic.messageArgs[0];
|
|
24
|
-
const targetBaseClass = baseClassChange.diagnostic.messageArgs[1];
|
|
25
|
-
if (targetBaseClass === undefined) {
|
|
26
|
-
const itemKey = sourceBaseClass.schema.schemaKey.matches(source.schema.schemaKey)
|
|
27
|
-
? new ecschema_metadata_1.SchemaItemKey(sourceBaseClass.name, target.schema.schemaKey)
|
|
28
|
-
: sourceBaseClass.key;
|
|
29
|
-
const baseClassEntity = await target.schema.context.getSchemaItem(itemKey);
|
|
30
|
-
if (baseClassEntity === undefined)
|
|
31
|
-
throw new Error(`Unable to locate base class ${sourceBaseClass.name} in schema ${target.schema.name}`);
|
|
32
|
-
const mutableTargetClass = target;
|
|
33
|
-
mutableTargetClass.baseClass = new ecschema_metadata_1.DelayedPromiseWithProps(baseClassEntity.key, async () => baseClassEntity);
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
throw new Error(`Failed to merge base class '${sourceBaseClass.name}': not supported case`);
|
|
13
|
+
class ClassMerger extends SchemaItemMerger_1.SchemaItemMerger {
|
|
14
|
+
async merge(itemKey, source, change) {
|
|
15
|
+
// This applies to all type of classes regardless if they are Entities, Structs, Mixins,...
|
|
16
|
+
// all can have properties that required to get merged.
|
|
17
|
+
await this.mergeBaseClasses(itemKey, source, change.baseClassDelta);
|
|
18
|
+
for (const propertyChange of change.propertyChanges.values()) {
|
|
19
|
+
await this.mergeProperties(itemKey, source, propertyChange);
|
|
37
20
|
}
|
|
38
21
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
: await mutableTargetClass.createPrimitiveProperty(propertyChange.ecTypeName, property.primitiveType);
|
|
52
|
-
await result.fromJSON(primitiveProps);
|
|
22
|
+
async mergeBaseClasses(itemKey, source, baseClassChange) {
|
|
23
|
+
if (baseClassChange !== undefined) {
|
|
24
|
+
const [sourceBaseClass, targetBaseClass] = baseClassChange.diagnostic.messageArgs;
|
|
25
|
+
if (targetBaseClass === undefined) {
|
|
26
|
+
const baseClassKey = sourceBaseClass.schema.schemaKey.matches(source.schema.schemaKey)
|
|
27
|
+
? new ecschema_metadata_1.SchemaItemKey(sourceBaseClass.name, itemKey.schemaKey)
|
|
28
|
+
: sourceBaseClass.key;
|
|
29
|
+
await this.context.editor.entities.setBaseClass(itemKey, baseClassKey);
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
throw new Error(`Failed to merge base class '${sourceBaseClass.name}': not supported case`);
|
|
33
|
+
}
|
|
53
34
|
}
|
|
54
|
-
|
|
55
|
-
|
|
35
|
+
}
|
|
36
|
+
async mergeProperties(itemKey, source, propertyChange) {
|
|
37
|
+
if (propertyChange.propertyMissing?.changeType === SchemaChanges_1.ChangeType.Missing) {
|
|
38
|
+
const property = await source.getProperty(propertyChange.ecTypeName);
|
|
39
|
+
if (property === undefined) {
|
|
40
|
+
throw Error(`Property '${propertyChange.ecTypeName}' not found in class ${source.name}`);
|
|
41
|
+
}
|
|
42
|
+
if (property.isPrimitive()) {
|
|
43
|
+
const primitiveProps = property.toJSON();
|
|
44
|
+
property.isArray()
|
|
45
|
+
? await this.context.editor.entities.createPrimitiveArrayPropertyFromProps(itemKey, propertyChange.ecTypeName, property.primitiveType, primitiveProps)
|
|
46
|
+
: await this.context.editor.entities.createPrimitivePropertyFromProps(itemKey, propertyChange.ecTypeName, property.primitiveType, primitiveProps);
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
throw Error(`Failed to merge '${propertyChange.ecTypeName}' property: not supported type`);
|
|
50
|
+
}
|
|
56
51
|
}
|
|
57
52
|
}
|
|
58
53
|
}
|
|
54
|
+
exports.default = ClassMerger;
|
|
59
55
|
//# sourceMappingURL=ClassMerger.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClassMerger.js","sourceRoot":"","sources":["../../../src/Merging/ClassMerger.ts"],"names":[],"mappings":";;AAAA
|
|
1
|
+
{"version":3,"file":"ClassMerger.js","sourceRoot":"","sources":["../../../src/Merging/ClassMerger.ts"],"names":[],"mappings":";;AAAA,kGAAkG;AAClG,sEAAsE;AACtE,oFAAoF;AACpF,kGAAkG;AAClG,gEAAkE;AAClE,+DAAwG;AACxG,yDAAsD;AAEtD;;GAEG;AACH,MAAqB,WAAY,SAAQ,mCAAyB;IAE7C,KAAK,CAAC,KAAK,CAAC,OAAsB,EAAE,MAAe,EAAE,MAAoB;QAC1F,2FAA2F;QAC3F,uDAAuD;QACvD,MAAM,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,cAAc,CAAC,CAAC;QAEpE,KAAI,MAAM,cAAc,IAAI,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE,EAAE;YAC3D,MAAM,IAAI,CAAC,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,cAAc,CAAC,CAAC;SAC7D;IACH,CAAC;IAEO,KAAK,CAAC,gBAAgB,CAAC,OAAsB,EAAE,MAAe,EAAE,eAAgC;QACtG,IAAI,eAAe,KAAK,SAAS,EAAE;YACjC,MAAM,CAAC,eAAe,EAAE,eAAe,CAAC,GAAG,eAAe,CAAC,UAAU,CAAC,WAAkC,CAAC;YACzG,IAAI,eAAe,KAAK,SAAS,EAAE;gBAEjC,MAAM,YAAY,GAAG,eAAe,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC;oBACpF,CAAC,CAAC,IAAI,iCAAa,CAAC,eAAe,CAAC,IAAI,EAAE,OAAO,CAAC,SAAS,CAAC;oBAC5D,CAAC,CAAC,eAAe,CAAC,GAAG,CAAC;gBAExB,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;aACxE;iBAAM;gBACL,MAAM,IAAI,KAAK,CAAC,+BAA+B,eAAe,CAAC,IAAI,uBAAuB,CAAC,CAAC;aAC7F;SACF;IACH,CAAC;IAEO,KAAK,CAAC,eAAe,CAAC,OAAsB,EAAE,MAAe,EAAE,cAA+B;QACpG,IAAI,cAAc,CAAC,eAAe,EAAE,UAAU,KAAK,0BAAU,CAAC,OAAO,EAAE;YAErE,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;YACrE,IAAI,QAAQ,KAAK,SAAS,EAAE;gBAC1B,MAAM,KAAK,CAAC,aAAa,cAAc,CAAC,UAAU,wBAAwB,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;aAC1F;YAED,IAAI,QAAQ,CAAC,WAAW,EAAE,EAAE;gBAC1B,MAAM,cAAc,GAAI,QAAQ,CAAC,MAAM,EAAE,CAAC;gBAC1C,QAAQ,CAAC,OAAO,EAAE;oBAChB,CAAC,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,qCAAqC,CAAC,OAAO,EAAE,cAAc,CAAC,UAAU,EAAE,QAAQ,CAAC,aAAa,EAAE,cAAc,CAAC;oBACtJ,CAAC,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,gCAAgC,CAAC,OAAO,EAAE,cAAc,CAAC,UAAU,EAAE,QAAQ,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC;aAErJ;iBAAM;gBACL,MAAM,KAAK,CAAC,oBAAoB,cAAc,CAAC,UAAU,gCAAgC,CAAC,CAAC;aAC5F;SACF;IACH,CAAC;CACF;AA/CD,8BA+CC","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 { ECClass, SchemaItemKey } from \"@itwin/ecschema-metadata\";\r\nimport { BaseClassDelta, ChangeType, ClassChanges, PropertyChanges } from \"../Validation/SchemaChanges\";\r\nimport { SchemaItemMerger } from \"./SchemaItemMerger\";\r\n\r\n/**\r\n * @internal\r\n */\r\nexport default class ClassMerger extends SchemaItemMerger<ECClass> {\r\n\r\n protected override async merge(itemKey: SchemaItemKey, source: ECClass, change: ClassChanges) {\r\n // This applies to all type of classes regardless if they are Entities, Structs, Mixins,...\r\n // all can have properties that required to get merged.\r\n await this.mergeBaseClasses(itemKey, source, change.baseClassDelta);\r\n\r\n for(const propertyChange of change.propertyChanges.values()) {\r\n await this.mergeProperties(itemKey, source, propertyChange);\r\n }\r\n }\r\n\r\n private async mergeBaseClasses(itemKey: SchemaItemKey, source: ECClass, baseClassChange?: BaseClassDelta) {\r\n if (baseClassChange !== undefined) {\r\n const [sourceBaseClass, targetBaseClass] = baseClassChange.diagnostic.messageArgs! as [ECClass, ECClass];\r\n if (targetBaseClass === undefined) {\r\n\r\n const baseClassKey = sourceBaseClass.schema.schemaKey.matches(source.schema.schemaKey)\r\n ? new SchemaItemKey(sourceBaseClass.name, itemKey.schemaKey)\r\n : sourceBaseClass.key;\r\n\r\n await this.context.editor.entities.setBaseClass(itemKey, baseClassKey);\r\n } else {\r\n throw new Error(`Failed to merge base class '${sourceBaseClass.name}': not supported case`);\r\n }\r\n }\r\n }\r\n\r\n private async mergeProperties(itemKey: SchemaItemKey, source: ECClass, propertyChange: PropertyChanges) {\r\n if (propertyChange.propertyMissing?.changeType === ChangeType.Missing) {\r\n\r\n const property = await source.getProperty(propertyChange.ecTypeName);\r\n if (property === undefined) {\r\n throw Error(`Property '${propertyChange.ecTypeName}' not found in class ${source.name}`);\r\n }\r\n\r\n if (property.isPrimitive()) {\r\n const primitiveProps = property.toJSON();\r\n property.isArray()\r\n ? await this.context.editor.entities.createPrimitiveArrayPropertyFromProps(itemKey, propertyChange.ecTypeName, property.primitiveType, primitiveProps)\r\n : await this.context.editor.entities.createPrimitivePropertyFromProps(itemKey, propertyChange.ecTypeName, property.primitiveType, primitiveProps);\r\n\r\n } else {\r\n throw Error(`Failed to merge '${propertyChange.ecTypeName}' property: not supported type`);\r\n }\r\n }\r\n }\r\n}\r\n"]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Constant } from "@itwin/ecschema-metadata";
|
|
2
|
-
import {
|
|
2
|
+
import { PropertyValueResolver, SchemaItemMerger } from "./SchemaItemMerger";
|
|
3
3
|
/**
|
|
4
4
|
* @internal
|
|
5
|
-
* @param target The constant the differences get merged into
|
|
6
|
-
* @param source The constant to compare
|
|
7
|
-
* @param changes Gets the @see SchemaItemChanges between the two constants.
|
|
8
|
-
* For example, if source constant has an attribute/property that it missing in
|
|
9
|
-
* target one, it would be listed in propertyValueChanges.
|
|
10
5
|
*/
|
|
11
|
-
export default
|
|
6
|
+
export default class ConstantsMerger extends SchemaItemMerger<Constant> {
|
|
7
|
+
/**
|
|
8
|
+
* Creates the property value resolver for [[Constant]] items.
|
|
9
|
+
*/
|
|
10
|
+
protected createPropertyValueResolver(): Promise<PropertyValueResolver<Constant>>;
|
|
11
|
+
}
|
|
12
12
|
//# sourceMappingURL=ConstantMerger.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConstantMerger.d.ts","sourceRoot":"","sources":["../../../src/Merging/ConstantMerger.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"ConstantMerger.d.ts","sourceRoot":"","sources":["../../../src/Merging/ConstantMerger.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAc,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE7E;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,gBAAgB,CAAC,QAAQ,CAAC;IACrE;;OAEG;cACsB,2BAA2B,IAAI,OAAO,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC;CA6BjG"}
|