@api-client/core 0.12.1 → 0.12.2
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/bin/plugins/sinon/assert.ts +29 -0
- package/bin/test.ts +2 -0
- package/build/src/browser.d.ts +4 -0
- package/build/src/browser.d.ts.map +1 -1
- package/build/src/browser.js +3 -0
- package/build/src/browser.js.map +1 -1
- package/build/src/index.d.ts +4 -0
- package/build/src/index.d.ts.map +1 -1
- package/build/src/index.js +3 -0
- package/build/src/index.js.map +1 -1
- package/build/src/modeling/DataDomain.d.ts +4 -0
- package/build/src/modeling/DataDomain.d.ts.map +1 -1
- package/build/src/modeling/DataDomain.js +11 -0
- package/build/src/modeling/DataDomain.js.map +1 -1
- package/build/src/modeling/DomainAssociation.js +1 -1
- package/build/src/modeling/DomainAssociation.js.map +1 -1
- package/build/src/modeling/DomainEntity.d.ts +46 -0
- package/build/src/modeling/DomainEntity.d.ts.map +1 -1
- package/build/src/modeling/DomainEntity.js +71 -0
- package/build/src/modeling/DomainEntity.js.map +1 -1
- package/build/src/modeling/DomainImpactAnalysis.d.ts +31 -8
- package/build/src/modeling/DomainImpactAnalysis.d.ts.map +1 -1
- package/build/src/modeling/DomainImpactAnalysis.js +118 -46
- package/build/src/modeling/DomainImpactAnalysis.js.map +1 -1
- package/build/src/modeling/DomainProperty.js +1 -1
- package/build/src/modeling/DomainProperty.js.map +1 -1
- package/build/src/modeling/validation/association_validation.d.ts +38 -0
- package/build/src/modeling/validation/association_validation.d.ts.map +1 -0
- package/build/src/modeling/validation/association_validation.js +108 -0
- package/build/src/modeling/validation/association_validation.js.map +1 -0
- package/build/src/modeling/validation/entity_validation.d.ts +52 -0
- package/build/src/modeling/validation/entity_validation.d.ts.map +1 -0
- package/build/src/modeling/validation/entity_validation.js +241 -0
- package/build/src/modeling/validation/entity_validation.js.map +1 -0
- package/build/src/modeling/validation/postgresql.d.ts +2 -0
- package/build/src/modeling/validation/postgresql.d.ts.map +1 -0
- package/build/src/modeling/validation/postgresql.js +58 -0
- package/build/src/modeling/validation/postgresql.js.map +1 -0
- package/build/src/modeling/validation/property_validation.d.ts +29 -0
- package/build/src/modeling/validation/property_validation.d.ts.map +1 -0
- package/build/src/modeling/validation/property_validation.js +58 -0
- package/build/src/modeling/validation/property_validation.js.map +1 -0
- package/build/src/modeling/validation/rules.d.ts +55 -0
- package/build/src/modeling/validation/rules.d.ts.map +1 -0
- package/build/src/modeling/validation/rules.js +110 -0
- package/build/src/modeling/validation/rules.js.map +1 -0
- package/data/models/example-generator-api.json +6 -6
- package/package.json +1 -1
- package/src/modeling/DataDomain.ts +12 -0
- package/src/modeling/DomainAssociation.ts +1 -1
- package/src/modeling/DomainEntity.ts +75 -0
- package/src/modeling/DomainImpactAnalysis.ts +144 -54
- package/src/modeling/DomainProperty.ts +1 -1
- package/src/modeling/validation/association_validation.ts +109 -0
- package/src/modeling/validation/entity_validation.ts +246 -0
- package/src/modeling/validation/postgresql.ts +57 -0
- package/src/modeling/validation/property_validation.ts +58 -0
- package/src/modeling/validation/rules.ts +152 -0
- package/tests/unit/modeling/data_domain_associations.spec.ts +1 -1
- package/tests/unit/modeling/data_domain_property.spec.ts +1 -1
- package/tests/unit/modeling/domain.property.spec.ts +7 -7
- package/tests/unit/modeling/domain_asociation.spec.ts +3 -3
- package/tests/unit/modeling/domain_entity_associations.spec.ts +1 -1
- package/tests/unit/modeling/domain_entity_properties.spec.ts +2 -2
- package/tests/unit/modeling/domain_impact_analysis.spec.ts +138 -29
- package/tests/unit/modeling/validation/association_validation.spec.ts +140 -0
- package/tests/unit/modeling/validation/entity_validation.spec.ts +192 -0
- package/tests/unit/modeling/validation/property_validation.spec.ts +125 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DomainImpactAnalysis.js","sourceRoot":"","sources":["../../../src/modeling/DomainImpactAnalysis.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,EACf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ourcesContent":["import {\n DomainNamespaceKind,\n DomainEntityKind,\n DomainModelKind,\n DomainPropertyKind,\n DomainAssociationKind,\n DataDomainKind,\n} from '../models/kinds.js'\nimport type { DataDomain } from './DataDomain.js'\n\nexport type DomainImpactKinds =\n | typeof DomainNamespaceKind\n | typeof DomainEntityKind\n | typeof DomainModelKind\n | typeof DomainPropertyKind\n | typeof DomainAssociationKind\n | typeof DataDomainKind\n\n/**\n * The impact analysis report\n */\nexport interface DomainImpactReport {\n /**\n * The key of the impacted data object.\n * This is the key of the object that is being changed.\n */\n key: string\n /**\n * The kind of the impacted data object.\n * This is the kind of the object that is being changed.\n */\n kind: DomainImpactKinds\n /**\n * The list of impacted data objects.\n */\n impact: DomainImpactItem[]\n /**\n * Whether it is possible to proceed with the change.\n * If the change is not possible, the reason will be in the impact list.\n */\n canProceed: boolean\n}\n\nexport interface DomainImpactItem {\n /**\n * The key of the impacted data object.\n */\n key: string\n /**\n * The kind of the impacted data object.\n */\n kind: string\n /**\n * The type of the impact.\n *\n * - `delete` - The data object would be deleted.\n */\n type: 'delete'\n /**\n * The impact description.\n */\n impact: string\n /**\n * Whether the impact is blocking the operation.\n * If true, the operation cannot proceed.\n */\n blocking: boolean\n /**\n * The type of the relationship between two impacted objects.\n */\n relationship?: 'child'\n /**\n * The resolution of the conflict if the change will be forced.\n */\n resolution?: string\n}\n\n/**\n * # DomainImpactAnalysis\n *\n * The `DomainImpactAnalysis` class is a tool for analyzing the consequences of deleting data domain elements\n * within a `DataDomain`. It helps developers understand the ripple effects of removing a namespace, data model,\n * entity, property, or association, ensuring data integrity and preventing unintended side effects.\n *\n * ## Core Concepts\n *\n * - **Impact Report:** The central output of the `DomainImpactAnalysis` class is an `DomainImpactReport`.\n * This report details the potential consequences of a deletion operation, including:\n * - The object being deleted (`key`, `kind`).\n * - A list of `DomainImpactItem` objects, each describing a specific consequence.\n * - Whether the deletion can proceed safely (`canProceed`).\n *\n * - **DomainImpactItem:** Each `DomainImpactItem` describes a specific consequence of the deletion.\n * Key properties include:\n * - `key`: The key of the impacted object.\n * - `kind`: The kind of the impacted object.\n * - `type`: The type of impact (currently only `delete`).\n * - `impact`: A human-readable description of the impact.\n * - `blocking`: Whether this impact prevents the deletion from proceeding.\n * - `relationship`: The type of relationship between the deleted object and the impacted object (e.g., `child`).\n * - `resolution`: A description of how the impact will be resolved if the deletion is forced.\n *\n * - **Blocking Impacts:** Some impacts are considered \"blocking,\" meaning they prevent the deletion from proceeding\n * without manual intervention. For example, deleting an entity that is a parent to other entities is\n * a blocking impact.\n *\n * - **Non-Blocking Impacts:** Some impacts are informational and do not prevent the deletion. For example, deleting a\n * property is not a blocking impact.\n *\n * ## Usage\n *\n * 1. **Instantiation:** Create an instance of `DomainImpactAnalysis`, passing the root `DataDomain` as an argument.\n *\n * ```typescript\n * import { DataDomain } from './DataDomain';\n * import { DomainImpactAnalysis } from './DomainImpactAnalysis';\n *\n * const dataDomain = new DataDomain();\n * // ... add some data to the domain\n * const analyzer = new DomainImpactAnalysis(dataDomain);\n * ```\n *\n * 2. **Performing Analysis:** Use the `deleteAnalysis()` method to generate an `DomainImpactReport` for\n * a specific deletion.\n * Provide the `key` and `kind` of the object to be deleted.\n *\n * ```typescript\n * import { DomainEntityKind } from '../models/kinds.js';\n * // ...\n * const entityKey = 'some-entity-key';\n * const report = analyzer.deleteAnalysis(entityKey, DomainEntityKind);\n * ```\n *\n * 3. **Interpreting the Report:** Examine the `DomainImpactReport` to understand the consequences of the deletion.\n * - Check `report.canProceed` to see if the deletion is safe.\n * - Iterate through `report.impact` to understand each consequence.\n * - Pay special attention to `impact.blocking` to identify impacts that require manual resolution.\n *\n * ```typescript\n * if (report.canProceed) {\n * // Proceed with deletion\n * } else {\n * console.warn('Deletion cannot proceed due to the following impacts:');\n * report.impact.forEach((item) => {\n * console.warn(`- ${item.impact}`);\n * if (item.blocking) {\n * console.warn(` - This impact is blocking.`);\n * if (item.resolution) {\n * console.warn(` - Resolution: ${item.resolution}`);\n * }\n * }\n * });\n * // Handle blocking impacts (e.g., prompt the user, modify the data, etc.)\n * }\n * ```\n *\n * ## Supported Deletion Scenarios\n *\n * The `DomainImpactAnalysis` class supports analyzing the deletion of the following data domain element types:\n *\n * - **Namespaces (`DomainNamespaceKind`):** Deleting a namespace also impacts all its child namespaces,\n * data models, entities, properties, and associations.\n * - **Data Models (`DomainModelKind`):** Deleting a data model impacts all its entities, properties, and associations.\n * - **Entities (`DomainEntityKind`):** Deleting an entity impacts its properties, associations, and any other\n * entities that have it as a parent or target in an association.\n * - **Properties (`DomainPropertyKind`):** Deleting a property impacts the entity it belongs to.\n * - **Associations (`DomainAssociationKind`):** Deleting an association impacts the entity it belongs to.\n * - **Data Domain (`DataDomainKind`):** Deleting a data domain is not supported.\n *\n * ## Example: Deleting an Entity\n *\n * Consider the following scenario:\n *\n * ```\n * DataDomain\n * - Namespace: `MyNamespace`\n * - Data Model: `ProductModel`\n * - Entity: `Product`\n * - Property: `name`\n * - Association: `category` (targets `Category` entity)\n * - Entity: `Category`\n * - Property: `name`\n * - Entity: `SpecialProduct` (parent: `Product`)\n * ```\n *\n * If you attempt to delete the `Product` entity, the `DomainImpactAnalysis` will generate a report similar to this:\n *\n * ```json\n * {\n * \"key\": \"Product\",\n * \"kind\": \"DomainEntityKind\",\n * \"impact\": [\n * {\n * \"key\": \"Product\",\n * \"kind\": \"DomainEntityKind\",\n * \"type\": \"delete\",\n * \"impact\": \"The entity with key Product will be deleted.\",\n * \"blocking\": false\n * },\n * {\n * \"key\": \"SpecialProduct\",\n * \"kind\": \"DomainEntityKind\",\n * \"type\": \"delete\",\n * \"impact\": \"The SpecialProduct entity will become an orphan because it is a child of Product.\",\n * \"resolution\": \"The \\\"Product\\\" entity will be removed as the parent of the \\\"SpecialProduct\\\" entity.\",\n * \"blocking\": true,\n * \"relationship\": \"child\"\n * },\n * {\n * \"key\": \"category\",\n * \"kind\": \"DomainAssociationKind\",\n * \"type\": \"delete\",\n * \"impact\": \"The association with key category will be broken because it has a target to Product.\",\n * \"resolution\": \"The association with key category will be removed from Product.\",\n * \"blocking\": true\n * },\n * {\n * \"key\": \"name\",\n * \"kind\": \"DomainPropertyKind\",\n * \"type\": \"delete\",\n * \"impact\": \"The property with key name will be deleted.\",\n * \"blocking\": false\n * }\n * ],\n * \"canProceed\": false\n * }\n * ```\n *\n * This report indicates that:\n *\n * - The `Product` entity will be deleted.\n * - The `SpecialProduct` entity will become an orphan (blocking).\n * - The `category` association will be broken (blocking).\n * - The `name` property will be deleted.\n * - The deletion cannot proceed without addressing the blocking impacts.\n *\n * ## Types\n *\n * ### `DomainImpactKinds`\n *\n * - **Description:** A type alias for the kinds of data domain elements that can be analyzed.\n * - **Values:**\n * - `DomainNamespaceKind`\n * - `DomainEntityKind`\n * - `DomainModelKind`\n * - `DomainPropertyKind`\n * - `DomainAssociationKind`\n * - `DataDomainKind`\n *\n * ### `DomainImpactReport`\n *\n * - **Description:** The structure of the impact analysis report.\n * - **Properties:**\n * - `key` (`string`): The key of the object being deleted.\n * - `kind` (`DomainImpactKinds`): The kind of the object being deleted.\n * - `impact` (`DomainImpactItem[]`): The list of impacts.\n * - `canProceed` (`boolean`): Whether the deletion can proceed.\n *\n * ### `DomainImpactItem`\n *\n * - **Description:** The structure of an individual impact item.\n * - **Properties:**\n * - `key` (`string`): The key of the impacted object.\n * - `kind` (`string`): The kind of the impacted object.\n * - `type` (`'delete'`): The type of impact.\n * - `impact` (`string`): The impact description.\n * - `blocking` (`boolean`): Whether the impact is blocking.\n * - `relationship` (`'child'`, optional): The relationship type.\n * - `resolution` (`string`, optional): The resolution description.\n *\n * ## Error Handling\n *\n * The `DomainImpactAnalysis` class does not throw errors. Instead, it uses the `DomainImpactReport` to communicate\n * the results of the analysis, including any blocking impacts.\n *\n * ## Best Practices\n *\n * - **Always Analyze Before Deleting:** Before deleting any data domain element, always use `DomainImpactAnalysis`\n * to understand the consequences.\n * - **Handle Blocking Impacts:** Pay close attention to `blocking` impacts and implement appropriate\n * logic to handle them.\n * - **Inform the User:** If a deletion cannot proceed, inform the user about the blocking impacts and provide\n * guidance on how to resolve them.\n * - **Consider Forced Deletion:** In some cases, you may want to allow users to force a deletion even if there are\n * blocking impacts. In such cases, you should clearly communicate the risks to the user.\n *\n * ## Conclusion\n *\n * The `DomainImpactAnalysis` class is an essential tool for maintaining data integrity when working with complex\n * data domain models. By providing detailed impact reports, it empowers developers to make informed decisions\n * about data deletion and prevent unintended consequences.\n */\nexport class DomainImpactAnalysis {\n private report: DomainImpactReport\n private root: DataDomain\n\n constructor(root: DataDomain) {\n this.root = root\n this.report = {\n key: '',\n kind: DataDomainKind,\n impact: [],\n canProceed: false,\n }\n }\n\n /**\n * Generates a report of how the data domain will be impacted by the deletion of a data domain object.\n * @param key The key of the impacted data domain object.\n * @param kind The kind of the impacted data object.\n * @returns The delete impact analysis report.\n */\n deleteAnalysis(key: string, kind: DomainImpactKinds): DomainImpactReport {\n this.report = {\n key,\n kind,\n impact: [],\n canProceed: true,\n }\n this.report.impact = this.createDeleteImpact(key, kind, key)\n return this.report\n }\n\n /**\n * Generates a report of how the data domain will be impacted by the removal of a foreign namespace.\n * @param key The key of the foreign namespace.\n * @returns The delete impact analysis report.\n */\n removeForeignNamespaceAnalysis(key: string): DomainImpactReport {\n this.report = {\n key,\n kind: DomainNamespaceKind,\n impact: [],\n canProceed: true,\n }\n this.report.impact = this.createRemoveForeignNamespaceImpact(key)\n return this.report\n }\n\n protected createDeleteImpact(key: string, kind: DomainImpactKinds, rootKey: string): DomainImpactItem[] {\n switch (kind) {\n case DomainNamespaceKind:\n return this.deleteNamespaceAnalysis(key, rootKey)\n case DomainModelKind:\n return this.deleteDataModelAnalysis(key, rootKey)\n case DomainEntityKind:\n return this.deleteEntityAnalysis(key, rootKey)\n case DomainPropertyKind:\n return this.deletePropertyAnalysis(key)\n case DomainAssociationKind:\n return this.deleteAssociationAnalysis(key)\n default:\n return []\n }\n }\n\n protected deleteNamespaceAnalysis(key: string, rootKey: string): DomainImpactItem[] {\n const result: DomainImpactItem[] = []\n const ns = this.root.findNamespace(key)\n if (!ns) {\n return result\n }\n result.push({\n key: ns.key,\n kind: ns.kind,\n type: 'delete',\n impact: `The ${ns.info.getLabel()} ${this.kindToLabel(DomainNamespaceKind)} will be deleted.`,\n blocking: false,\n })\n for (const child of ns.listNamespaces()) {\n const items = this.deleteNamespaceAnalysis(child.key, rootKey)\n result.push(...items)\n }\n for (const child of ns.listModels()) {\n const items = this.deleteDataModelAnalysis(child.key, rootKey)\n result.push(...items)\n }\n return result\n }\n\n protected deleteDataModelAnalysis(key: string, rootKey: string): DomainImpactItem[] {\n const result: DomainImpactItem[] = []\n const model = this.root.findModel(key)\n if (!model) {\n return result\n }\n result.push({\n key: model.key,\n kind: model.kind,\n type: 'delete',\n impact: `The ${model.info.getLabel()} ${this.kindToLabel(DomainModelKind)} will be deleted.`,\n blocking: false,\n })\n for (const child of model.listEntities()) {\n const items = this.deleteEntityAnalysis(child.key, rootKey)\n result.push(...items)\n }\n return result\n }\n\n protected deleteEntityAnalysis(key: string, rootKey: string): DomainImpactItem[] {\n const result: DomainImpactItem[] = []\n const entity = this.root.findEntity(key)\n if (!entity) {\n return result\n }\n result.push({\n key: entity.key,\n kind: entity.kind,\n type: 'delete',\n impact: `The ${entity.info.getLabel()} ${this.kindToLabel(DomainEntityKind)} will be deleted.`,\n blocking: false,\n })\n\n // We need to know whether the entity is a parent of another entity\n for (const info of this.root.graph.inEdges(key)) {\n const edge = this.root.graph.edge(info)\n if (!edge || edge.type !== 'parent') {\n continue\n }\n const childEntity = this.root.findEntity(info.v)\n if (!childEntity) {\n continue\n }\n if (childEntity.isChildOf(rootKey)) {\n // No need to include this child as it itself is being deleted\n continue\n }\n const pLabel = entity.info.getLabel()\n const cLabel = childEntity.info.getLabel()\n result.push({\n key: childEntity.key,\n kind: childEntity.kind,\n type: 'delete',\n impact: `The \"${cLabel}\" ${this.kindToLabel(DomainEntityKind)} will become an orphan because it is a child of the \"${pLabel}\" entity.`,\n resolution: `The \"${pLabel}\" entity will be removed as the parent of the \"${cLabel}\" entity.`,\n blocking: true,\n relationship: 'child',\n })\n this.report.canProceed = false\n }\n // We need to know whether there's another entity that has an association to this entity.\n for (const edgeInfo of this.root.graph.inEdges(entity.key)) {\n const edge = this.root.graph.edge(edgeInfo)\n if (!edge || edge.type !== 'association') {\n continue\n }\n const association = this.root.findAssociation(edgeInfo.v)\n if (!association) {\n continue\n }\n const targetEntity = association.getParentInstance()\n if (!targetEntity) {\n continue\n }\n if (targetEntity.isChildOf(rootKey)) {\n // No need to include this association as the target entity itself is being deleted\n continue\n }\n\n const aLabel = association.info.getLabel()\n const eLabel = entity.info.getLabel()\n result.push({\n key: association.key,\n kind: association.kind,\n type: 'delete',\n impact: `The ${aLabel} ${this.kindToLabel(DomainAssociationKind)} will be broken because it has a target to ${eLabel}.`,\n resolution: `The ${aLabel} ${this.kindToLabel(DomainAssociationKind)} will be removed from ${eLabel}.`,\n blocking: true,\n })\n this.report.canProceed = false\n }\n for (const child of entity.listProperties()) {\n const items = this.deletePropertyAnalysis(child.key)\n result.push(...items)\n }\n for (const child of entity.listAssociations()) {\n const items = this.deleteAssociationAnalysis(child.key)\n result.push(...items)\n }\n return result\n }\n\n protected deletePropertyAnalysis(key: string): DomainImpactItem[] {\n const result: DomainImpactItem[] = []\n const property = this.root.findProperty(key)\n if (!property) {\n return result\n }\n result.push({\n key: property.key,\n kind: property.kind,\n type: 'delete',\n impact: `The ${property.info.getLabel()} ${this.kindToLabel(DomainPropertyKind)} will be deleted.`,\n blocking: false,\n })\n return result\n }\n\n protected deleteAssociationAnalysis(key: string): DomainImpactItem[] {\n const result: DomainImpactItem[] = []\n const association = this.root.findAssociation(key)\n if (!association) {\n return result\n }\n result.push({\n key: association.key,\n kind: association.kind,\n type: 'delete',\n impact: `The ${association.info.getLabel()} ${this.kindToLabel(DomainAssociationKind)} will be deleted.`,\n blocking: false,\n })\n return result\n }\n\n protected kindToLabel(kind: DomainImpactKinds): string {\n switch (kind) {\n case DomainNamespaceKind:\n return 'namespace'\n case DomainEntityKind:\n return 'entity'\n case DomainModelKind:\n return 'data model'\n case DomainPropertyKind:\n return 'property'\n case DomainAssociationKind:\n return 'association'\n default:\n return 'unknown'\n }\n }\n\n protected createRemoveForeignNamespaceImpact(key: string): DomainImpactItem[] {\n const result: DomainImpactItem[] = []\n const foreignNamespace = this.root.dependencies.get(key)\n if (!foreignNamespace) {\n return result\n }\n // Check for parent relationships to foreign entities\n for (const entity of this.root.listEntities()) {\n for (const info of this.root.graph.outEdges(entity.key)) {\n const edge = this.root.graph.edge(info)\n if (!edge) {\n continue\n }\n if (edge.type === 'parent' && edge.domain === key) {\n // the parent is in the foreign namespace\n const parentEntity = this.root.findEntity(info.w)\n if (!parentEntity) {\n continue\n }\n const eLabel = entity.info.getLabel()\n const pLabel = parentEntity.info.getLabel()\n result.push({\n key: entity.key,\n kind: entity.kind,\n type: 'delete',\n impact: `The \"${eLabel}\" ${this.kindToLabel(DomainEntityKind)} will become an orphan because its parent \"${pLabel}\" is in the foreign namespace \"${foreignNamespace.key}\".`,\n resolution: `The \"${pLabel}\" entity will be removed as the parent of the \"${eLabel}\" entity.`,\n blocking: true,\n relationship: 'child',\n })\n this.report.canProceed = false\n } else if (edge.type === 'association') {\n const association = this.root.findAssociation(info.w)\n if (!association) {\n continue\n }\n const targets = association.targets.filter((t) => t.domain === key)\n if (targets.length) {\n for (const info of targets) {\n const targetEntity = this.root.findForeignEntity(info.key, info.domain as string)\n if (!targetEntity) {\n continue\n }\n const aLabel = association.info.getLabel()\n const eLabel = entity.info.getLabel()\n const tLabel = targetEntity.info.getLabel()\n result.push({\n key: association.key,\n kind: association.kind,\n type: 'delete',\n impact: `The \"${aLabel}\" ${this.kindToLabel(DomainAssociationKind)} from \"${eLabel}\" will be broken because it targets \"${tLabel}\" in the foreign namespace \"${foreignNamespace.key}\".`,\n resolution: `The \"${aLabel}\" ${this.kindToLabel(DomainAssociationKind)} will be removed from \"${eLabel}\".`,\n blocking: true,\n })\n this.report.canProceed = false\n }\n }\n }\n }\n }\n return result\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"DomainImpactAnalysis.js","sourceRoot":"","sources":["../../../src/modeling/DomainImpactAnalysis.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EAClB,qBAAqB,EACrB,cAAc,GACf,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAA;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAA;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAA;AAsFxE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsNG;AACH,MAAM,OAAO,oBAAoB;IACvB,MAAM,CAAoB;IAC1B,IAAI,CAAY;IAExB,YAAY,IAAgB;QAC1B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,MAAM,GAAG;YACZ,GAAG,EAAE,EAAE;YACP,IAAI,EAAE,cAAc;YACpB,MAAM,EAAE,EAAE;YACV,UAAU,EAAE,KAAK;SAClB,CAAA;IACH,CAAC;IAED;;;;;OAKG;IACH,cAAc,CAAC,GAAW,EAAE,IAAuB;QACjD,IAAI,CAAC,MAAM,GAAG;YACZ,GAAG;YACH,IAAI;YACJ,MAAM,EAAE,EAAE;YACV,UAAU,EAAE,IAAI;SACjB,CAAA;QACD,IAAI,CAAC,kBAAkB,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,CAAC,CAAA;QACvC,OAAO,IAAI,CA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0BAA0B,MAAM,IAAI;gCAC1G,QAAQ,EAAE,IAAI;gCACd,QAAQ,EAAE,OAAO;6BAClB,CAAC,CAAA;4BACF,IAAI,CAAC,MAAM,CAAC,UAAU,GAAG,KAAK,CAAA;wBAChC,CAAC;oBACH,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;CACF","sourcesContent":["import {\n DomainNamespaceKind,\n DomainEntityKind,\n DomainModelKind,\n DomainPropertyKind,\n DomainAssociationKind,\n DataDomainKind,\n} from '../models/kinds.js'\nimport type { DataDomain } from './DataDomain.js'\nimport { AssociationValidation } from './validation/association_validation.js'\nimport { EntityValidation } from './validation/entity_validation.js'\nimport { PropertyValidation } from './validation/property_validation.js'\n\nexport type DomainImpactKinds =\n | typeof DomainNamespaceKind\n | typeof DomainEntityKind\n | typeof DomainModelKind\n | typeof DomainPropertyKind\n | typeof DomainAssociationKind\n | typeof DataDomainKind\n\n/**\n * The impact analysis report\n */\nexport interface DomainImpactReport {\n /**\n * The key of the impacted data object.\n * This is the key of the object that is being changed.\n */\n key: string\n /**\n * The kind of the impacted data object.\n * This is the kind of the object that is being changed.\n */\n kind: DomainImpactKinds\n /**\n * The list of impacted data objects.\n */\n impact: DomainImpactItem[]\n /**\n * Whether it is possible to proceed with the change.\n * If the change is not possible, the reason will be in the impact list.\n */\n canProceed: boolean\n}\n\nexport interface DomainImpactItem {\n /**\n * The key of the impacted data object.\n */\n key: string\n /**\n * The kind of the impacted data object.\n */\n kind: string\n /**\n * The type of the impact.\n *\n * - `delete` - The data object would be deleted.\n */\n type: 'delete' | 'publish'\n /**\n * The impact description.\n * Explains what will happen to the impacted data object.\n * This is a human-readable description of the impact.\n * It should be clear and concise.\n */\n impact: string\n /**\n * The severity of the impact.\n *\n * - `info` - The impact is informational.\n * - `warning` - The impact can potentially cause problems but is not a blocker.\n * - `error` - The impact is a blocker and needs to be resolved before proceeding.\n */\n severity: 'info' | 'warning' | 'error'\n /**\n * Whether the impact is blocking the operation.\n * If true, the operation cannot proceed.\n * @deprecated Use `severity` instead.\n */\n blocking: boolean\n /**\n * The type of the relationship between two impacted objects.\n */\n relationship?: 'child'\n /**\n * The resolution of the conflict if the change will be forced.\n */\n resolution?: string\n /**\n * The optional parent of the impacted data object.\n * For example, if the impacted item is a property, this will be the entity it belongs to.\n */\n parent?: string\n}\n\n/**\n * # DomainImpactAnalysis\n *\n * The `DomainImpactAnalysis` class is a tool for analyzing the consequences of deleting data domain elements\n * within a `DataDomain`. It helps developers understand the ripple effects of removing a namespace, data model,\n * entity, property, or association, ensuring data integrity and preventing unintended side effects.\n *\n * ## Core Concepts\n *\n * - **Impact Report:** The central output of the `DomainImpactAnalysis` class is an `DomainImpactReport`.\n * This report details the potential consequences of a deletion operation, including:\n * - The object being deleted (`key`, `kind`).\n * - A list of `DomainImpactItem` objects, each describing a specific consequence.\n * - Whether the deletion can proceed safely (`canProceed`).\n *\n * - **DomainImpactItem:** Each `DomainImpactItem` describes a specific consequence of the deletion.\n * Key properties include:\n * - `key`: The key of the impacted object.\n * - `kind`: The kind of the impacted object.\n * - `type`: The type of impact (currently only `delete`).\n * - `impact`: A human-readable description of the impact.\n * - `blocking`: Whether this impact prevents the deletion from proceeding.\n * - `relationship`: The type of relationship between the deleted object and the impacted object (e.g., `child`).\n * - `resolution`: A description of how the impact will be resolved if the deletion is forced.\n *\n * - **Blocking Impacts:** Some impacts are considered \"blocking,\" meaning they prevent the deletion from proceeding\n * without manual intervention. For example, deleting an entity that is a parent to other entities is\n * a blocking impact.\n *\n * - **Non-Blocking Impacts:** Some impacts are informational and do not prevent the deletion. For example, deleting a\n * property is not a blocking impact.\n *\n * ## Usage\n *\n * 1. **Instantiation:** Create an instance of `DomainImpactAnalysis`, passing the root `DataDomain` as an argument.\n *\n * ```typescript\n * import { DataDomain } from './DataDomain';\n * import { DomainImpactAnalysis } from './DomainImpactAnalysis';\n *\n * const dataDomain = new DataDomain();\n * // ... add some data to the domain\n * const analyzer = new DomainImpactAnalysis(dataDomain);\n * ```\n *\n * 2. **Performing Analysis:** Use the `deleteAnalysis()` method to generate an `DomainImpactReport` for\n * a specific deletion.\n * Provide the `key` and `kind` of the object to be deleted.\n *\n * ```typescript\n * import { DomainEntityKind } from '../models/kinds.js';\n * // ...\n * const entityKey = 'some-entity-key';\n * const report = analyzer.deleteAnalysis(entityKey, DomainEntityKind);\n * ```\n *\n * 3. **Interpreting the Report:** Examine the `DomainImpactReport` to understand the consequences of the deletion.\n * - Check `report.canProceed` to see if the deletion is safe.\n * - Iterate through `report.impact` to understand each consequence.\n * - Pay special attention to `impact.blocking` to identify impacts that require manual resolution.\n *\n * ```typescript\n * if (report.canProceed) {\n * // Proceed with deletion\n * } else {\n * console.warn('Deletion cannot proceed due to the following impacts:');\n * report.impact.forEach((item) => {\n * console.warn(`- ${item.impact}`);\n * if (item.blocking) {\n * console.warn(` - This impact is blocking.`);\n * if (item.resolution) {\n * console.warn(` - Resolution: ${item.resolution}`);\n * }\n * }\n * });\n * // Handle blocking impacts (e.g., prompt the user, modify the data, etc.)\n * }\n * ```\n *\n * ## Supported Deletion Scenarios\n *\n * The `DomainImpactAnalysis` class supports analyzing the deletion of the following data domain element types:\n *\n * - **Namespaces (`DomainNamespaceKind`):** Deleting a namespace also impacts all its child namespaces,\n * data models, entities, properties, and associations.\n * - **Data Models (`DomainModelKind`):** Deleting a data model impacts all its entities, properties, and associations.\n * - **Entities (`DomainEntityKind`):** Deleting an entity impacts its properties, associations, and any other\n * entities that have it as a parent or target in an association.\n * - **Properties (`DomainPropertyKind`):** Deleting a property impacts the entity it belongs to.\n * - **Associations (`DomainAssociationKind`):** Deleting an association impacts the entity it belongs to.\n * - **Data Domain (`DataDomainKind`):** Deleting a data domain is not supported.\n *\n * ## Example: Deleting an Entity\n *\n * Consider the following scenario:\n *\n * ```\n * DataDomain\n * - Namespace: `MyNamespace`\n * - Data Model: `ProductModel`\n * - Entity: `Product`\n * - Property: `name`\n * - Association: `category` (targets `Category` entity)\n * - Entity: `Category`\n * - Property: `name`\n * - Entity: `SpecialProduct` (parent: `Product`)\n * ```\n *\n * If you attempt to delete the `Product` entity, the `DomainImpactAnalysis` will generate a report similar to this:\n *\n * ```json\n * {\n * \"key\": \"Product\",\n * \"kind\": \"DomainEntityKind\",\n * \"impact\": [\n * {\n * \"key\": \"Product\",\n * \"kind\": \"DomainEntityKind\",\n * \"type\": \"delete\",\n * \"impact\": \"The entity with key Product will be deleted.\",\n * \"blocking\": false\n * },\n * {\n * \"key\": \"SpecialProduct\",\n * \"kind\": \"DomainEntityKind\",\n * \"type\": \"delete\",\n * \"impact\": \"The SpecialProduct entity will become an orphan because it is a child of Product.\",\n * \"resolution\": \"The \\\"Product\\\" entity will be removed as the parent of the \\\"SpecialProduct\\\" entity.\",\n * \"blocking\": true,\n * \"relationship\": \"child\"\n * },\n * {\n * \"key\": \"category\",\n * \"kind\": \"DomainAssociationKind\",\n * \"type\": \"delete\",\n * \"impact\": \"The association with key category will be broken because it has a target to Product.\",\n * \"resolution\": \"The association with key category will be removed from Product.\",\n * \"blocking\": true\n * },\n * {\n * \"key\": \"name\",\n * \"kind\": \"DomainPropertyKind\",\n * \"type\": \"delete\",\n * \"impact\": \"The property with key name will be deleted.\",\n * \"blocking\": false\n * }\n * ],\n * \"canProceed\": false\n * }\n * ```\n *\n * This report indicates that:\n *\n * - The `Product` entity will be deleted.\n * - The `SpecialProduct` entity will become an orphan (blocking).\n * - The `category` association will be broken (blocking).\n * - The `name` property will be deleted.\n * - The deletion cannot proceed without addressing the blocking impacts.\n *\n * ## Types\n *\n * ### `DomainImpactKinds`\n *\n * - **Description:** A type alias for the kinds of data domain elements that can be analyzed.\n * - **Values:**\n * - `DomainNamespaceKind`\n * - `DomainEntityKind`\n * - `DomainModelKind`\n * - `DomainPropertyKind`\n * - `DomainAssociationKind`\n * - `DataDomainKind`\n *\n * ### `DomainImpactReport`\n *\n * - **Description:** The structure of the impact analysis report.\n * - **Properties:**\n * - `key` (`string`): The key of the object being deleted.\n * - `kind` (`DomainImpactKinds`): The kind of the object being deleted.\n * - `impact` (`DomainImpactItem[]`): The list of impacts.\n * - `canProceed` (`boolean`): Whether the deletion can proceed.\n *\n * ### `DomainImpactItem`\n *\n * - **Description:** The structure of an individual impact item.\n * - **Properties:**\n * - `key` (`string`): The key of the impacted object.\n * - `kind` (`string`): The kind of the impacted object.\n * - `type` (`'delete'`): The type of impact.\n * - `impact` (`string`): The impact description.\n * - `blocking` (`boolean`): Whether the impact is blocking.\n * - `relationship` (`'child'`, optional): The relationship type.\n * - `resolution` (`string`, optional): The resolution description.\n *\n * ## Error Handling\n *\n * The `DomainImpactAnalysis` class does not throw errors. Instead, it uses the `DomainImpactReport` to communicate\n * the results of the analysis, including any blocking impacts.\n *\n * ## Best Practices\n *\n * - **Always Analyze Before Deleting:** Before deleting any data domain element, always use `DomainImpactAnalysis`\n * to understand the consequences.\n * - **Handle Blocking Impacts:** Pay close attention to `blocking` impacts and implement appropriate\n * logic to handle them.\n * - **Inform the User:** If a deletion cannot proceed, inform the user about the blocking impacts and provide\n * guidance on how to resolve them.\n * - **Consider Forced Deletion:** In some cases, you may want to allow users to force a deletion even if there are\n * blocking impacts. In such cases, you should clearly communicate the risks to the user.\n *\n * ## Conclusion\n *\n * The `DomainImpactAnalysis` class is an essential tool for maintaining data integrity when working with complex\n * data domain models. By providing detailed impact reports, it empowers developers to make informed decisions\n * about data deletion and prevent unintended consequences.\n */\nexport class DomainImpactAnalysis {\n private report: DomainImpactReport\n private root: DataDomain\n\n constructor(root: DataDomain) {\n this.root = root\n this.report = {\n key: '',\n kind: DataDomainKind,\n impact: [],\n canProceed: false,\n }\n }\n\n /**\n * Generates a report of how the data domain will be impacted by the deletion of a data domain object.\n * @param key The key of the impacted data domain object.\n * @param kind The kind of the impacted data object.\n * @returns The delete impact analysis report.\n */\n deleteAnalysis(key: string, kind: DomainImpactKinds): DomainImpactReport {\n this.report = {\n key,\n kind,\n impact: [],\n canProceed: true,\n }\n this.createDeleteImpact(key, kind, key)\n return this.report\n }\n\n /**\n * Generates a report of how the data domain will be impacted by the removal of a foreign namespace.\n * @param key The key of the foreign namespace.\n * @returns The delete impact analysis report.\n */\n removeForeignNamespaceAnalysis(key: string): DomainImpactReport {\n this.report = {\n key,\n kind: DomainNamespaceKind,\n impact: [],\n canProceed: true,\n }\n this.createRemoveForeignNamespaceImpact(key)\n return this.report\n }\n\n /**\n * Analyzes the data domain for publishing. Essentially, it performs a validation of the data domain\n * and returns a report of the impact.\n * @returns The publish impact analysis report.\n */\n publishAnalysis(): DomainImpactReport {\n this.report = {\n key: '',\n kind: DataDomainKind,\n impact: [],\n canProceed: true,\n }\n const entityValidator = new EntityValidation(this.root)\n const propertyValidator = new PropertyValidation(this.root)\n const associationValidator = new AssociationValidation(this.root)\n for (const entity of this.root.listEntities()) {\n if (entity.domain.key !== this.root.key) {\n // we don't need to validate foreign entities\n continue\n }\n const report = entityValidator.validate(entity)\n for (const item of report) {\n const blocking = item.severity === 'error'\n this.report.canProceed = this.report.canProceed && !blocking\n this.report.impact.push({\n key: item.key,\n kind: item.kind,\n type: 'publish',\n impact: item.message,\n blocking,\n resolution: item.help,\n severity: item.severity,\n parent: item.parent,\n })\n }\n for (const property of entity.properties) {\n const report = propertyValidator.validate(property)\n for (const item of report) {\n const blocking = item.severity === 'error'\n this.report.canProceed = this.report.canProceed && !blocking\n this.report.impact.push({\n key: item.key,\n kind: item.kind,\n type: 'publish',\n impact: item.message,\n blocking,\n resolution: item.help,\n severity: item.severity,\n parent: item.parent,\n })\n }\n }\n for (const association of entity.associations) {\n const report = associationValidator.validate(association)\n for (const item of report) {\n const blocking = item.severity === 'error'\n this.report.canProceed = this.report.canProceed && !blocking\n this.report.impact.push({\n key: item.key,\n kind: item.kind,\n type: 'publish',\n impact: item.message,\n blocking,\n resolution: item.help,\n severity: item.severity,\n parent: item.parent,\n })\n }\n }\n }\n return this.report\n }\n\n protected createDeleteImpact(key: string, kind: DomainImpactKinds, rootKey: string): void {\n switch (kind) {\n case DomainNamespaceKind:\n this.deleteNamespaceAnalysis(key, rootKey)\n break\n case DomainModelKind:\n this.deleteDataModelAnalysis(key, rootKey)\n break\n case DomainEntityKind:\n this.deleteEntityAnalysis(key, rootKey)\n break\n case DomainPropertyKind:\n this.deletePropertyAnalysis(key)\n break\n case DomainAssociationKind:\n this.deleteAssociationAnalysis(key)\n break\n default:\n // ignore unknown kinds\n }\n }\n\n protected deleteNamespaceAnalysis(key: string, rootKey: string): void {\n const ns = this.root.findNamespace(key)\n if (!ns) {\n return\n }\n this.report.impact.push({\n key: ns.key,\n kind: ns.kind,\n type: 'delete',\n impact: `The ${ns.info.getLabel()} ${this.kindToLabel(DomainNamespaceKind)} will be deleted.`,\n blocking: false,\n severity: 'info',\n })\n for (const child of ns.listNamespaces()) {\n this.deleteNamespaceAnalysis(child.key, rootKey)\n }\n for (const child of ns.listModels()) {\n this.deleteDataModelAnalysis(child.key, rootKey)\n }\n }\n\n protected deleteDataModelAnalysis(key: string, rootKey: string): void {\n const model = this.root.findModel(key)\n if (!model) {\n return\n }\n this.report.impact.push({\n key: model.key,\n kind: model.kind,\n type: 'delete',\n impact: `The ${model.info.getLabel()} ${this.kindToLabel(DomainModelKind)} will be deleted.`,\n blocking: false,\n severity: 'info',\n })\n for (const child of model.listEntities()) {\n this.deleteEntityAnalysis(child.key, rootKey)\n }\n }\n\n protected deleteEntityAnalysis(key: string, rootKey: string): void {\n const entity = this.root.findEntity(key)\n if (!entity) {\n return\n }\n this.report.impact.push({\n key: entity.key,\n kind: entity.kind,\n type: 'delete',\n impact: `The ${entity.info.getLabel()} ${this.kindToLabel(DomainEntityKind)} will be deleted.`,\n blocking: false,\n severity: 'info',\n })\n\n // We need to know whether the entity is a parent of another entity\n for (const info of this.root.graph.inEdges(key)) {\n const edge = this.root.graph.edge(info)\n if (!edge || edge.type !== 'parent') {\n continue\n }\n const childEntity = this.root.findEntity(info.v)\n if (!childEntity) {\n continue\n }\n if (childEntity.isChildOf(rootKey)) {\n // No need to include this child as it itself is being deleted\n continue\n }\n const pLabel = entity.info.getLabel()\n const cLabel = childEntity.info.getLabel()\n this.report.impact.push({\n key: childEntity.key,\n kind: childEntity.kind,\n type: 'delete',\n impact: `The \"${cLabel}\" ${this.kindToLabel(DomainEntityKind)} will become an orphan because it is a child of the \"${pLabel}\" entity.`,\n resolution: `The \"${pLabel}\" entity will be removed as the parent of the \"${cLabel}\" entity.`,\n blocking: false,\n relationship: 'child',\n severity: 'error',\n })\n this.report.canProceed = false\n }\n // We need to know whether there's another entity that has an association to this entity.\n for (const edgeInfo of this.root.graph.inEdges(entity.key)) {\n const edge = this.root.graph.edge(edgeInfo)\n if (!edge || edge.type !== 'association') {\n continue\n }\n const association = this.root.findAssociation(edgeInfo.v)\n if (!association) {\n continue\n }\n const targetEntity = association.getParentInstance()\n if (!targetEntity) {\n continue\n }\n if (targetEntity.isChildOf(rootKey)) {\n // No need to include this association as the target entity itself is being deleted\n continue\n }\n\n const aLabel = association.info.getLabel()\n const eLabel = entity.info.getLabel()\n this.report.impact.push({\n key: association.key,\n kind: association.kind,\n type: 'delete',\n impact: `The ${aLabel} ${this.kindToLabel(DomainAssociationKind)} will be broken because it has a target to ${eLabel}.`,\n resolution: `The ${aLabel} ${this.kindToLabel(DomainAssociationKind)} will be removed from ${eLabel}.`,\n blocking: true,\n severity: 'error',\n })\n this.report.canProceed = false\n }\n for (const child of entity.listProperties()) {\n this.deletePropertyAnalysis(child.key)\n }\n for (const child of entity.listAssociations()) {\n this.deleteAssociationAnalysis(child.key)\n }\n }\n\n protected deletePropertyAnalysis(key: string): void {\n const property = this.root.findProperty(key)\n if (!property) {\n return\n }\n this.report.impact.push({\n key: property.key,\n kind: property.kind,\n type: 'delete',\n impact: `The ${property.info.getLabel()} ${this.kindToLabel(DomainPropertyKind)} will be deleted.`,\n blocking: false,\n severity: 'info',\n })\n }\n\n protected deleteAssociationAnalysis(key: string): void {\n const association = this.root.findAssociation(key)\n if (!association) {\n return\n }\n this.report.impact.push({\n key: association.key,\n kind: association.kind,\n type: 'delete',\n impact: `The ${association.info.getLabel()} ${this.kindToLabel(DomainAssociationKind)} will be deleted.`,\n blocking: false,\n severity: 'info',\n })\n }\n\n protected kindToLabel(kind: DomainImpactKinds): string {\n switch (kind) {\n case DomainNamespaceKind:\n return 'namespace'\n case DomainEntityKind:\n return 'entity'\n case DomainModelKind:\n return 'data model'\n case DomainPropertyKind:\n return 'property'\n case DomainAssociationKind:\n return 'association'\n default:\n return 'unknown'\n }\n }\n\n protected createRemoveForeignNamespaceImpact(key: string): void {\n const foreignNamespace = this.root.dependencies.get(key)\n if (!foreignNamespace) {\n return\n }\n // Check for parent relationships to foreign entities\n for (const entity of this.root.listEntities()) {\n for (const info of this.root.graph.outEdges(entity.key)) {\n const edge = this.root.graph.edge(info)\n if (!edge) {\n continue\n }\n if (edge.type === 'parent' && edge.domain === key) {\n // the parent is in the foreign namespace\n const parentEntity = this.root.findEntity(info.w)\n if (!parentEntity) {\n continue\n }\n const eLabel = entity.info.getLabel()\n const pLabel = parentEntity.info.getLabel()\n this.report.impact.push({\n key: entity.key,\n kind: entity.kind,\n type: 'delete',\n impact: `The \"${eLabel}\" ${this.kindToLabel(DomainEntityKind)} will become an orphan because its parent \"${pLabel}\" is in the foreign namespace \"${foreignNamespace.key}\".`,\n resolution: `The \"${pLabel}\" entity will be removed as the parent of the \"${eLabel}\" entity.`,\n blocking: true,\n relationship: 'child',\n severity: 'error',\n })\n this.report.canProceed = false\n } else if (edge.type === 'association') {\n const association = this.root.findAssociation(info.w)\n if (!association) {\n continue\n }\n const targets = association.targets.filter((t) => t.domain === key)\n if (targets.length) {\n for (const info of targets) {\n const targetEntity = this.root.findForeignEntity(info.key, info.domain as string)\n if (!targetEntity) {\n continue\n }\n const aLabel = association.info.getLabel()\n const eLabel = entity.info.getLabel()\n const tLabel = targetEntity.info.getLabel()\n this.report.impact.push({\n key: association.key,\n kind: association.kind,\n type: 'delete',\n impact: `The \"${aLabel}\" ${this.kindToLabel(DomainAssociationKind)} from \"${eLabel}\" will be broken because it targets \"${tLabel}\" in the foreign namespace \"${foreignNamespace.key}\".`,\n resolution: `The \"${aLabel}\" ${this.kindToLabel(DomainAssociationKind)} will be removed from \"${eLabel}\".`,\n blocking: true,\n severity: 'error',\n })\n this.report.canProceed = false\n }\n }\n }\n }\n }\n }\n}\n"]}
|
|
@@ -253,7 +253,7 @@ let DomainProperty = (() => {
|
|
|
253
253
|
throw new Error(`Invalid data property type ${type}`);
|
|
254
254
|
}
|
|
255
255
|
}
|
|
256
|
-
const info = Thing.fromJSON(input.info, { name: '
|
|
256
|
+
const info = Thing.fromJSON(input.info, { name: 'new_property' }).toJSON();
|
|
257
257
|
const result = {
|
|
258
258
|
kind: DomainPropertyKind,
|
|
259
259
|
key,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DomainProperty.js","sourceRoot":"","sources":["../../../src/modeling/DomainProperty.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AACvD,OAAO,EAAE,aAAa,EAA4B,MAAM,oBAAoB,CAAA;AAC5E,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAe,KAAK,EAAE,MAAM,oBAAoB,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAC/D,OAAO,EAEL,aAAa,EAEb,wBAAwB,EAExB,kBAAkB,EAElB,mBAAmB,EAEnB,aAAa,GACd,MAAM,iBAAiB,CAAA;AAKxB,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAsExD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;IACU,cAAc;sBAAS,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAApC,cAAe,SAAQ,WAAa;;;gCAM9C,cAAc,EAAE;oCAKhB,QAAQ,EAAE;oCAKV,QAAQ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EAAE,EAAqB,CAAA;gBACvD,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;YAC5B,CAAC;YACD,OAAO,MAAM,CAAC,MAA6B,CAAA;QAC7C,CAAC;QAED;;;;WAIG;QACH,WAAW,CAAC,IAAwB;YAClC,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAoB,CAAA;YAC1E,OAAO,IAAI,EAAE,MAAM,IAAI,SAAS,CAAA;QAClC,CAAC;QAED;;;;;;;;;;;;WAYG;QACH,UAAU;YACR,MAAM,UAAU,GAAG,IAAI,cAAc,EAAE,CAAA;YACvC,OAAO,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;QAClC,CAAC;;;SA5ZU,cAAc","sourcesContent":["import type { DataDomain } from './DataDomain.js'\nimport { DomainPropertyKind } from '../models/kinds.js'\nimport { DomainElement, type DomainElementSchema } from './DomainElement.js'\nimport { nanoid } from 'nanoid'\nimport { type IThing, Thing } from '../models/Thing.js'\nimport { observed, retargetChange, toRaw } from './observed.js'\nimport {\n type BinaryFormat,\n BinaryFormats,\n type DomainPropertyAttribute,\n DomainPropertyAttributes,\n type DomainPropertyFormat,\n DomainPropertyList,\n type DomainPropertyType,\n DomainPropertyTypes,\n type NumberFormat,\n NumberFormats,\n} from './DataFormat.js'\nimport type { PropertyBinding, PropertyBindings, PropertyWebBindings } from './Bindings.js'\nimport type { ModelValidationOptions } from '../models/types.js'\nimport type { DomainEntity } from './DomainEntity.js'\nimport type { IApiPropertyShape } from '../amf/definitions/Shapes.js'\nimport { ShapeGenerator } from './amf/ShapeGenerator.js'\nimport { PropertySchema } from './types.js'\n\nexport interface DomainPropertySchema extends DomainElementSchema {\n kind: typeof DomainPropertyKind\n /**\n * The domain property description.\n */\n info: IThing\n /**\n * Wether the data property is required.\n */\n required?: boolean\n /**\n * Whether the data property allows multiple items.\n */\n multiple?: boolean\n /**\n * Whether this property describes a primary key of the entity.\n */\n primary?: boolean\n /**\n * Whether this property describes an indexed property of the entity.\n */\n index?: boolean\n /**\n * Whether the property is read only in the schema.\n */\n readOnly?: boolean\n /**\n * Whether the property is write only in the schema.\n */\n writeOnly?: boolean\n /**\n * Whether this property is deprecated.\n */\n deprecated?: boolean\n /**\n * Optional general purpose tags for the UI.\n */\n tags?: string[]\n /**\n * For future use.\n *\n * The keys of the taxonomy items associated with the property.\n */\n taxonomy?: string[]\n /**\n * The data type for this property.\n * Note, not all schemas support the same type. For example, defining `sint32`\n * works for protocol buffers, but does not for JSON. In such case we use default\n * translation `sint32` -> `number`. Another way it to create\n * a derivative entity for specific schema to describe specific schema case.\n */\n type: DomainPropertyType\n /**\n * The general schema definition of this property.\n * This is propagated to all bindings (when they support these properties).\n */\n schema?: PropertySchema\n /**\n * The list of bindings for this property.\n *\n * A binding defines a translation from a data model to a specific format.\n * For example allows to define properties required to generate AMF shape and therefore RAML/OAS shapes for web APIs\n * or a protocol buffer schema.\n */\n bindings?: PropertyBinding[]\n}\n\n/**\n * Represents a property within a data domain entity.\n *\n * A `DomainProperty` defines a single data element within a\n * `DomainEntity`. It specifies the data type, constraints,\n * and other metadata for a specific piece of information.\n *\n * **Key Features:**\n *\n * - **Data Type:** Defines the type of data the property\n * holds (e.g., string, number, boolean, date).\n * - **Constraints:** Supports defining constraints such as\n * minimum/maximum values, enum values, and default values.\n * - **Bindings:** Allows defining how the property is\n * represented in different formats (e.g., web APIs,\n * protocol buffers).\n * - **Metadata:** Supports metadata such as tags, taxonomy,\n * read-only/write-only status, and deprecation.\n * - **Schema:** Allows defining a general schema for the\n * property, which is propagated to all bindings.\n *\n * **Usage:**\n *\n * Use the `DataEntity.addProperty` method to add a new property to an\n * entity. The property can be created using the constructor, but it\n * won't be added to the graph until you call the `addProperty` method.\n *\n * **Example:**\n *\n * ```typescript\n * const entity = dataModel.addEntity({ key: 'user' });\n * const property = entity.addProperty({\n * key: 'name',\n * type: 'string',\n * required: true,\n * schema: {\n * minimum: 3,\n * maximum: 50,\n * },\n * });\n * ```\n */\nexport class DomainProperty extends DomainElement {\n override kind: typeof DomainPropertyKind\n\n /**\n * The description of the domain property.\n */\n @retargetChange() accessor info: Thing\n\n /**\n * Wether the data property is required.\n */\n @observed() accessor required: boolean | undefined\n\n /**\n * Whether the data property allows multiple items.\n */\n @observed() accessor multiple: boolean | undefined\n\n /**\n * Whether this property describes a primary key of the entity.\n */\n @observed() accessor primary: boolean | undefined\n\n /**\n * Whether this property describes an indexed property of the entity.\n */\n @observed() accessor index: boolean | undefined\n\n /**\n * Whether the property is read only in the schema.\n */\n @observed() accessor readOnly: boolean | undefined\n\n /**\n * Whether the property is write only in the schema.\n */\n @observed() accessor writeOnly: boolean | undefined\n\n /**\n * Whether this property is deprecated.\n */\n @observed() accessor deprecated: boolean | undefined\n\n /**\n * Optional general purpose tags for the UI.\n *\n * Note to implementations, use the `addTag()` method as it propagates the \"tag\" value in the namespace.\n * Also, the tags property is excluded from the observer properties.\n * Changes to this property will not notify the observers.\n */\n @observed({ deep: true }) accessor tags: string[] = []\n\n /**\n * Reserved for future use.\n *\n * The keys of the taxonomy items associated with the property.\n */\n @observed({ deep: true }) accessor taxonomy: string[] = []\n\n /**\n * The data type for this property.\n * Note, not all schemas support the same type. For example, defining `sint32`\n * works for protocol buffers but does not for JSON. In such case we use default\n * translation `sint32` -> `number`. Another way it to create\n * a derivative entity for specific schema to describe specific schema case.\n */\n @observed() accessor type: DomainPropertyType = 'string'\n\n /**\n * The general schema definition of this property.\n * This is propagated to all bindings (when they support these properties).\n */\n @observed({ deep: true }) accessor schema: PropertySchema | undefined\n\n /**\n * The list of bindings for this property.\n *\n * A binding defines a translation from a data model to a specific format.\n * For example allows to define properties required to generate AMF shape and therefore RAML/OAS shapes for web APIs\n * or a protocol buffer schema.\n */\n @observed({ deep: true }) accessor bindings: PropertyBinding[] = []\n\n /**\n * Creates a full data model schema with defaults.\n *\n * @param input The partial data model schema.\n * @returns The data model schema.\n */\n static createSchema(input: Partial<DomainPropertySchema> = {}): DomainPropertySchema {\n const {\n key = nanoid(),\n multiple,\n required,\n type = DomainPropertyList.string,\n index,\n primary,\n readOnly,\n writeOnly,\n tags,\n taxonomy,\n deprecated,\n schema,\n bindings,\n } = input\n if (typeof type === 'string') {\n if (!DomainPropertyTypes.includes(type as DomainPropertyType)) {\n throw new Error(`Invalid data property type ${type}`)\n }\n }\n const info = Thing.fromJSON(input.info, { name: 'New property' }).toJSON()\n const result: DomainPropertySchema = {\n kind: DomainPropertyKind,\n key,\n info,\n type,\n }\n if (typeof multiple === 'boolean') {\n result.multiple = multiple\n }\n if (typeof required === 'boolean') {\n result.required = required\n }\n if (typeof index === 'boolean') {\n result.index = index\n }\n if (typeof primary === 'boolean') {\n result.primary = primary\n }\n if (typeof readOnly === 'boolean') {\n result.readOnly = readOnly\n }\n if (typeof writeOnly === 'boolean') {\n result.writeOnly = writeOnly\n }\n if (typeof deprecated === 'boolean') {\n result.deprecated = deprecated\n }\n if (Array.isArray(tags)) {\n result.tags = [...tags]\n }\n if (Array.isArray(taxonomy)) {\n result.taxonomy = [...taxonomy]\n }\n if (schema) {\n result.schema = structuredClone(schema)\n }\n if (Array.isArray(bindings)) {\n result.bindings = bindings.map((i) => structuredClone(i))\n } else {\n result.bindings = []\n }\n return result\n }\n\n /**\n * The key of the parent entity.\n */\n protected parent: string\n\n /**\n * Creates a new domain property instance.\n * It does not add it to the graph.\n * You need to call the `addProperty` method of the graph or a data model to add it.\n *\n * Domain objects constructors shouldn't be used directly. Use methods\n * provided on the DataDomain class to create new objects.\n *\n * @param root A reference to the root DataDomain instance.\n * @param parent The key of the parent entity.\n * @param input The partial domain property schema.\n * @returns Created domain property instance.\n */\n constructor(root: DataDomain, parent: string, input: Partial<DomainPropertySchema> = {}) {\n const init = DomainProperty.createSchema(input)\n super(root, init.key)\n this.parent = parent\n this.kind = DomainPropertyKind\n this.info = new Thing(init.info)\n this.type = init.type\n\n if (typeof init.multiple === 'boolean') {\n this.multiple = init.multiple\n } else {\n this.multiple = undefined\n }\n if (typeof init.required === 'boolean') {\n this.required = init.required\n } else {\n this.required = undefined\n }\n if (typeof init.index === 'boolean') {\n this.index = init.index\n } else {\n this.index = undefined\n }\n if (typeof init.deprecated === 'boolean') {\n this.deprecated = init.deprecated\n } else {\n this.deprecated = undefined\n }\n if (typeof init.primary === 'boolean') {\n this.primary = init.primary\n } else {\n this.primary = undefined\n }\n if (typeof init.readOnly === 'boolean') {\n this.readOnly = init.readOnly\n } else {\n this.readOnly = undefined\n }\n if (typeof init.writeOnly === 'boolean') {\n this.writeOnly = init.writeOnly\n } else {\n this.writeOnly = undefined\n }\n if (Array.isArray(init.tags)) {\n this.tags = [...init.tags]\n } else {\n this.tags = []\n }\n if (Array.isArray(init.taxonomy)) {\n this.taxonomy = [...init.taxonomy]\n } else {\n this.taxonomy = []\n }\n if (init.schema) {\n this.schema = structuredClone(init.schema)\n } else {\n this.schema = undefined\n }\n if (Array.isArray(init.bindings)) {\n this.bindings = init.bindings.map((i) => structuredClone(i))\n } else {\n this.bindings = []\n }\n }\n\n /**\n * Checks whether the input is a valid definition of a domain property.\n *\n * @param input The input to validate.\n * @param options Validation options.\n * @returns true when the passed input is a valid definition of a domain property.\n */\n static validate(input: unknown, options: ModelValidationOptions = {}): boolean {\n if (!input || (typeof input !== 'object' && input !== null)) {\n return false\n }\n const typed = input as DomainPropertySchema\n if (options.strict && typed.kind !== DomainPropertyKind) {\n return false\n }\n return true\n }\n\n toJSON(): DomainPropertySchema {\n const result: DomainPropertySchema = {\n kind: this.kind,\n key: this.key,\n info: this.info.toJSON(),\n type: this.type || DomainPropertyList.string,\n }\n if (typeof this.index === 'boolean') {\n result.index = this.index\n }\n if (typeof this.deprecated === 'boolean') {\n result.deprecated = this.deprecated\n }\n if (typeof this.primary === 'boolean') {\n result.primary = this.primary\n }\n if (typeof this.multiple === 'boolean') {\n result.multiple = this.multiple\n }\n if (typeof this.required === 'boolean') {\n result.required = this.required\n }\n if (typeof this.readOnly === 'boolean') {\n result.readOnly = this.readOnly\n }\n if (typeof this.writeOnly === 'boolean') {\n result.writeOnly = this.writeOnly\n }\n if (Array.isArray(this.tags) && this.tags.length) {\n result.tags = [...this.tags]\n }\n if (Array.isArray(this.taxonomy) && this.taxonomy.length) {\n result.taxonomy = [...this.taxonomy]\n }\n if (this.schema) {\n result.schema = structuredClone(toRaw(this, this.schema))\n }\n if (Array.isArray(this.bindings) && this.bindings.length) {\n result.bindings = toRaw(this, this.bindings)?.map((i) => structuredClone(i))\n }\n return result\n }\n\n /**\n * Removes this property from the parent entity.\n * It calls the `removeProperty()` method of the parent entity.\n */\n remove(): void {\n const parent = this.getParentInstance()\n parent?.removeProperty(this.key)\n }\n\n /**\n * Returns a parent data entity where this data property exist.\n */\n getParentInstance(): DomainEntity | undefined {\n return this.root.graph.node(this.parent) as DomainEntity | undefined\n }\n\n /**\n * Checks whether the passed value is one of the supported data types.\n * @param value The value to test\n * @returns True when the passed value is one of the supported data types.\n */\n static isValidType(value: unknown): value is DomainPropertyType {\n if (typeof value !== 'string') {\n return false\n }\n return DomainPropertyTypes.includes(value as DomainPropertyType)\n }\n\n /**\n * Checks whether the passed value is one of the supported data property attributes.\n * @param value The value to test\n * @returns True when the passed value is one of the supported data property attributes.\n */\n static isValidAttribute(value: unknown): value is DomainPropertyAttribute {\n if (typeof value !== 'string') {\n return false\n }\n return DomainPropertyAttributes.includes(value as DomainPropertyAttribute)\n }\n\n /**\n * Checks whether the passed value of one of the supported `format` values.\n *\n * @param value The value to test\n * @returns `true` when the value is one of the supported `format` values.\n */\n static isValidFormat(value: unknown): value is DomainPropertyFormat {\n if (value === undefined) {\n // It is the valid value.\n return true\n }\n if (typeof value !== 'string') {\n return false\n }\n if (NumberFormats.includes(value as NumberFormat)) {\n return true\n }\n if (BinaryFormats.includes(value as BinaryFormat)) {\n return true\n }\n return false\n }\n\n /**\n * Creates the `schema` object if missing and returns it.\n * @returns The schema object.\n */\n ensureSchema(): PropertySchema {\n if (!this.schema) {\n this.schema = {}\n }\n return this.schema\n }\n\n /**\n * Creates if not existing and returns web bindings definition.\n * @returns The web binding definition\n */\n getWebBinding(): PropertyWebBindings {\n let object = this.bindings.find((i) => i.type === 'web') as PropertyBinding | undefined\n if (!object) {\n object = { type: 'web', schema: {} } as PropertyBinding\n this.bindings.push(object)\n }\n return object.schema as PropertyWebBindings\n }\n\n /**\n * Returns the schema value of the binding, if any was created.\n * @param type The type of the binding to read.\n * @returns The binding schema, if any\n */\n readBinding(type: 'web' | 'protobuf'): PropertyBindings | undefined {\n const item = this.bindings.find((i) => i.type === type) as PropertyBinding\n return item?.schema || undefined\n }\n\n /**\n * Creates a Property Shape of AMF.\n *\n * The property itself is auto-generated. If the `schema` is\n * defined then it is used as the `range` of the property.\n * Otherwise basic shape is generated for the range.\n *\n * This is a preferred way of reading the AMF shape as this\n * synchronizes changed data properties with the shape\n * definition.\n *\n * @returns AMF property shape definition.\n */\n toApiShape(): IApiPropertyShape {\n const serializer = new ShapeGenerator()\n return serializer.property(this)\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"DomainProperty.js","sourceRoot":"","sources":["../../../src/modeling/DomainProperty.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AACvD,OAAO,EAAE,aAAa,EAA4B,MAAM,oBAAoB,CAAA;AAC5E,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAe,KAAK,EAAE,MAAM,oBAAoB,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAC/D,OAAO,EAEL,aAAa,EAEb,wBAAwB,EAExB,kBAAkB,EAElB,mBAAmB,EAEnB,aAAa,GACd,MAAM,iBAAiB,CAAA;AAKxB,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAsExD;;;;;;;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CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,KAAK,CAAgC,CAAA;YACvF,IAAI,CAAC,MAAM,EAAE,CAAC;gBACZ,MAAM,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAqB,CAAA;gBACvD,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;YAC5B,CAAC;YACD,OAAO,MAAM,CAAC,MAA6B,CAAA;QAC7C,CAAC;QAED;;;;WAIG;QACH,WAAW,CAAC,IAAwB;YAClC,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAoB,CAAA;YAC1E,OAAO,IAAI,EAAE,MAAM,IAAI,SAAS,CAAA;QAClC,CAAC;QAED;;;;;;;;;;;;WAYG;QACH,UAAU;YACR,MAAM,UAAU,GAAG,IAAI,cAAc,EAAE,CAAA;YACvC,OAAO,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;QAClC,CAAC;;;SA5ZU,cAAc","sourcesContent":["import type { DataDomain } from './DataDomain.js'\nimport { DomainPropertyKind } from '../models/kinds.js'\nimport { DomainElement, type DomainElementSchema } from './DomainElement.js'\nimport { nanoid } from 'nanoid'\nimport { type IThing, Thing } from '../models/Thing.js'\nimport { observed, retargetChange, toRaw } from './observed.js'\nimport {\n type BinaryFormat,\n BinaryFormats,\n type DomainPropertyAttribute,\n DomainPropertyAttributes,\n type DomainPropertyFormat,\n DomainPropertyList,\n type DomainPropertyType,\n DomainPropertyTypes,\n type NumberFormat,\n NumberFormats,\n} from './DataFormat.js'\nimport type { PropertyBinding, PropertyBindings, PropertyWebBindings } from './Bindings.js'\nimport type { ModelValidationOptions } from '../models/types.js'\nimport type { DomainEntity } from './DomainEntity.js'\nimport type { IApiPropertyShape } from '../amf/definitions/Shapes.js'\nimport { ShapeGenerator } from './amf/ShapeGenerator.js'\nimport { PropertySchema } from './types.js'\n\nexport interface DomainPropertySchema extends DomainElementSchema {\n kind: typeof DomainPropertyKind\n /**\n * The domain property description.\n */\n info: IThing\n /**\n * Wether the data property is required.\n */\n required?: boolean\n /**\n * Whether the data property allows multiple items.\n */\n multiple?: boolean\n /**\n * Whether this property describes a primary key of the entity.\n */\n primary?: boolean\n /**\n * Whether this property describes an indexed property of the entity.\n */\n index?: boolean\n /**\n * Whether the property is read only in the schema.\n */\n readOnly?: boolean\n /**\n * Whether the property is write only in the schema.\n */\n writeOnly?: boolean\n /**\n * Whether this property is deprecated.\n */\n deprecated?: boolean\n /**\n * Optional general purpose tags for the UI.\n */\n tags?: string[]\n /**\n * For future use.\n *\n * The keys of the taxonomy items associated with the property.\n */\n taxonomy?: string[]\n /**\n * The data type for this property.\n * Note, not all schemas support the same type. For example, defining `sint32`\n * works for protocol buffers, but does not for JSON. In such case we use default\n * translation `sint32` -> `number`. Another way it to create\n * a derivative entity for specific schema to describe specific schema case.\n */\n type: DomainPropertyType\n /**\n * The general schema definition of this property.\n * This is propagated to all bindings (when they support these properties).\n */\n schema?: PropertySchema\n /**\n * The list of bindings for this property.\n *\n * A binding defines a translation from a data model to a specific format.\n * For example allows to define properties required to generate AMF shape and therefore RAML/OAS shapes for web APIs\n * or a protocol buffer schema.\n */\n bindings?: PropertyBinding[]\n}\n\n/**\n * Represents a property within a data domain entity.\n *\n * A `DomainProperty` defines a single data element within a\n * `DomainEntity`. It specifies the data type, constraints,\n * and other metadata for a specific piece of information.\n *\n * **Key Features:**\n *\n * - **Data Type:** Defines the type of data the property\n * holds (e.g., string, number, boolean, date).\n * - **Constraints:** Supports defining constraints such as\n * minimum/maximum values, enum values, and default values.\n * - **Bindings:** Allows defining how the property is\n * represented in different formats (e.g., web APIs,\n * protocol buffers).\n * - **Metadata:** Supports metadata such as tags, taxonomy,\n * read-only/write-only status, and deprecation.\n * - **Schema:** Allows defining a general schema for the\n * property, which is propagated to all bindings.\n *\n * **Usage:**\n *\n * Use the `DataEntity.addProperty` method to add a new property to an\n * entity. The property can be created using the constructor, but it\n * won't be added to the graph until you call the `addProperty` method.\n *\n * **Example:**\n *\n * ```typescript\n * const entity = dataModel.addEntity({ key: 'user' });\n * const property = entity.addProperty({\n * key: 'name',\n * type: 'string',\n * required: true,\n * schema: {\n * minimum: 3,\n * maximum: 50,\n * },\n * });\n * ```\n */\nexport class DomainProperty extends DomainElement {\n override kind: typeof DomainPropertyKind\n\n /**\n * The description of the domain property.\n */\n @retargetChange() accessor info: Thing\n\n /**\n * Wether the data property is required.\n */\n @observed() accessor required: boolean | undefined\n\n /**\n * Whether the data property allows multiple items.\n */\n @observed() accessor multiple: boolean | undefined\n\n /**\n * Whether this property describes a primary key of the entity.\n */\n @observed() accessor primary: boolean | undefined\n\n /**\n * Whether this property describes an indexed property of the entity.\n */\n @observed() accessor index: boolean | undefined\n\n /**\n * Whether the property is read only in the schema.\n */\n @observed() accessor readOnly: boolean | undefined\n\n /**\n * Whether the property is write only in the schema.\n */\n @observed() accessor writeOnly: boolean | undefined\n\n /**\n * Whether this property is deprecated.\n */\n @observed() accessor deprecated: boolean | undefined\n\n /**\n * Optional general purpose tags for the UI.\n *\n * Note to implementations, use the `addTag()` method as it propagates the \"tag\" value in the namespace.\n * Also, the tags property is excluded from the observer properties.\n * Changes to this property will not notify the observers.\n */\n @observed({ deep: true }) accessor tags: string[] = []\n\n /**\n * Reserved for future use.\n *\n * The keys of the taxonomy items associated with the property.\n */\n @observed({ deep: true }) accessor taxonomy: string[] = []\n\n /**\n * The data type for this property.\n * Note, not all schemas support the same type. For example, defining `sint32`\n * works for protocol buffers but does not for JSON. In such case we use default\n * translation `sint32` -> `number`. Another way it to create\n * a derivative entity for specific schema to describe specific schema case.\n */\n @observed() accessor type: DomainPropertyType = 'string'\n\n /**\n * The general schema definition of this property.\n * This is propagated to all bindings (when they support these properties).\n */\n @observed({ deep: true }) accessor schema: PropertySchema | undefined\n\n /**\n * The list of bindings for this property.\n *\n * A binding defines a translation from a data model to a specific format.\n * For example allows to define properties required to generate AMF shape and therefore RAML/OAS shapes for web APIs\n * or a protocol buffer schema.\n */\n @observed({ deep: true }) accessor bindings: PropertyBinding[] = []\n\n /**\n * Creates a full data model schema with defaults.\n *\n * @param input The partial data model schema.\n * @returns The data model schema.\n */\n static createSchema(input: Partial<DomainPropertySchema> = {}): DomainPropertySchema {\n const {\n key = nanoid(),\n multiple,\n required,\n type = DomainPropertyList.string,\n index,\n primary,\n readOnly,\n writeOnly,\n tags,\n taxonomy,\n deprecated,\n schema,\n bindings,\n } = input\n if (typeof type === 'string') {\n if (!DomainPropertyTypes.includes(type as DomainPropertyType)) {\n throw new Error(`Invalid data property type ${type}`)\n }\n }\n const info = Thing.fromJSON(input.info, { name: 'new_property' }).toJSON()\n const result: DomainPropertySchema = {\n kind: DomainPropertyKind,\n key,\n info,\n type,\n }\n if (typeof multiple === 'boolean') {\n result.multiple = multiple\n }\n if (typeof required === 'boolean') {\n result.required = required\n }\n if (typeof index === 'boolean') {\n result.index = index\n }\n if (typeof primary === 'boolean') {\n result.primary = primary\n }\n if (typeof readOnly === 'boolean') {\n result.readOnly = readOnly\n }\n if (typeof writeOnly === 'boolean') {\n result.writeOnly = writeOnly\n }\n if (typeof deprecated === 'boolean') {\n result.deprecated = deprecated\n }\n if (Array.isArray(tags)) {\n result.tags = [...tags]\n }\n if (Array.isArray(taxonomy)) {\n result.taxonomy = [...taxonomy]\n }\n if (schema) {\n result.schema = structuredClone(schema)\n }\n if (Array.isArray(bindings)) {\n result.bindings = bindings.map((i) => structuredClone(i))\n } else {\n result.bindings = []\n }\n return result\n }\n\n /**\n * The key of the parent entity.\n */\n protected parent: string\n\n /**\n * Creates a new domain property instance.\n * It does not add it to the graph.\n * You need to call the `addProperty` method of the graph or a data model to add it.\n *\n * Domain objects constructors shouldn't be used directly. Use methods\n * provided on the DataDomain class to create new objects.\n *\n * @param root A reference to the root DataDomain instance.\n * @param parent The key of the parent entity.\n * @param input The partial domain property schema.\n * @returns Created domain property instance.\n */\n constructor(root: DataDomain, parent: string, input: Partial<DomainPropertySchema> = {}) {\n const init = DomainProperty.createSchema(input)\n super(root, init.key)\n this.parent = parent\n this.kind = DomainPropertyKind\n this.info = new Thing(init.info)\n this.type = init.type\n\n if (typeof init.multiple === 'boolean') {\n this.multiple = init.multiple\n } else {\n this.multiple = undefined\n }\n if (typeof init.required === 'boolean') {\n this.required = init.required\n } else {\n this.required = undefined\n }\n if (typeof init.index === 'boolean') {\n this.index = init.index\n } else {\n this.index = undefined\n }\n if (typeof init.deprecated === 'boolean') {\n this.deprecated = init.deprecated\n } else {\n this.deprecated = undefined\n }\n if (typeof init.primary === 'boolean') {\n this.primary = init.primary\n } else {\n this.primary = undefined\n }\n if (typeof init.readOnly === 'boolean') {\n this.readOnly = init.readOnly\n } else {\n this.readOnly = undefined\n }\n if (typeof init.writeOnly === 'boolean') {\n this.writeOnly = init.writeOnly\n } else {\n this.writeOnly = undefined\n }\n if (Array.isArray(init.tags)) {\n this.tags = [...init.tags]\n } else {\n this.tags = []\n }\n if (Array.isArray(init.taxonomy)) {\n this.taxonomy = [...init.taxonomy]\n } else {\n this.taxonomy = []\n }\n if (init.schema) {\n this.schema = structuredClone(init.schema)\n } else {\n this.schema = undefined\n }\n if (Array.isArray(init.bindings)) {\n this.bindings = init.bindings.map((i) => structuredClone(i))\n } else {\n this.bindings = []\n }\n }\n\n /**\n * Checks whether the input is a valid definition of a domain property.\n *\n * @param input The input to validate.\n * @param options Validation options.\n * @returns true when the passed input is a valid definition of a domain property.\n */\n static validate(input: unknown, options: ModelValidationOptions = {}): boolean {\n if (!input || (typeof input !== 'object' && input !== null)) {\n return false\n }\n const typed = input as DomainPropertySchema\n if (options.strict && typed.kind !== DomainPropertyKind) {\n return false\n }\n return true\n }\n\n toJSON(): DomainPropertySchema {\n const result: DomainPropertySchema = {\n kind: this.kind,\n key: this.key,\n info: this.info.toJSON(),\n type: this.type || DomainPropertyList.string,\n }\n if (typeof this.index === 'boolean') {\n result.index = this.index\n }\n if (typeof this.deprecated === 'boolean') {\n result.deprecated = this.deprecated\n }\n if (typeof this.primary === 'boolean') {\n result.primary = this.primary\n }\n if (typeof this.multiple === 'boolean') {\n result.multiple = this.multiple\n }\n if (typeof this.required === 'boolean') {\n result.required = this.required\n }\n if (typeof this.readOnly === 'boolean') {\n result.readOnly = this.readOnly\n }\n if (typeof this.writeOnly === 'boolean') {\n result.writeOnly = this.writeOnly\n }\n if (Array.isArray(this.tags) && this.tags.length) {\n result.tags = [...this.tags]\n }\n if (Array.isArray(this.taxonomy) && this.taxonomy.length) {\n result.taxonomy = [...this.taxonomy]\n }\n if (this.schema) {\n result.schema = structuredClone(toRaw(this, this.schema))\n }\n if (Array.isArray(this.bindings) && this.bindings.length) {\n result.bindings = toRaw(this, this.bindings)?.map((i) => structuredClone(i))\n }\n return result\n }\n\n /**\n * Removes this property from the parent entity.\n * It calls the `removeProperty()` method of the parent entity.\n */\n remove(): void {\n const parent = this.getParentInstance()\n parent?.removeProperty(this.key)\n }\n\n /**\n * Returns a parent data entity where this data property exist.\n */\n getParentInstance(): DomainEntity | undefined {\n return this.root.graph.node(this.parent) as DomainEntity | undefined\n }\n\n /**\n * Checks whether the passed value is one of the supported data types.\n * @param value The value to test\n * @returns True when the passed value is one of the supported data types.\n */\n static isValidType(value: unknown): value is DomainPropertyType {\n if (typeof value !== 'string') {\n return false\n }\n return DomainPropertyTypes.includes(value as DomainPropertyType)\n }\n\n /**\n * Checks whether the passed value is one of the supported data property attributes.\n * @param value The value to test\n * @returns True when the passed value is one of the supported data property attributes.\n */\n static isValidAttribute(value: unknown): value is DomainPropertyAttribute {\n if (typeof value !== 'string') {\n return false\n }\n return DomainPropertyAttributes.includes(value as DomainPropertyAttribute)\n }\n\n /**\n * Checks whether the passed value of one of the supported `format` values.\n *\n * @param value The value to test\n * @returns `true` when the value is one of the supported `format` values.\n */\n static isValidFormat(value: unknown): value is DomainPropertyFormat {\n if (value === undefined) {\n // It is the valid value.\n return true\n }\n if (typeof value !== 'string') {\n return false\n }\n if (NumberFormats.includes(value as NumberFormat)) {\n return true\n }\n if (BinaryFormats.includes(value as BinaryFormat)) {\n return true\n }\n return false\n }\n\n /**\n * Creates the `schema` object if missing and returns it.\n * @returns The schema object.\n */\n ensureSchema(): PropertySchema {\n if (!this.schema) {\n this.schema = {}\n }\n return this.schema\n }\n\n /**\n * Creates if not existing and returns web bindings definition.\n * @returns The web binding definition\n */\n getWebBinding(): PropertyWebBindings {\n let object = this.bindings.find((i) => i.type === 'web') as PropertyBinding | undefined\n if (!object) {\n object = { type: 'web', schema: {} } as PropertyBinding\n this.bindings.push(object)\n }\n return object.schema as PropertyWebBindings\n }\n\n /**\n * Returns the schema value of the binding, if any was created.\n * @param type The type of the binding to read.\n * @returns The binding schema, if any\n */\n readBinding(type: 'web' | 'protobuf'): PropertyBindings | undefined {\n const item = this.bindings.find((i) => i.type === type) as PropertyBinding\n return item?.schema || undefined\n }\n\n /**\n * Creates a Property Shape of AMF.\n *\n * The property itself is auto-generated. If the `schema` is\n * defined then it is used as the `range` of the property.\n * Otherwise basic shape is generated for the range.\n *\n * This is a preferred way of reading the AMF shape as this\n * synchronizes changed data properties with the shape\n * definition.\n *\n * @returns AMF property shape definition.\n */\n toApiShape(): IApiPropertyShape {\n const serializer = new ShapeGenerator()\n return serializer.property(this)\n }\n}\n"]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { DataDomain } from '../DataDomain.js';
|
|
2
|
+
import type { DomainAssociation } from '../DomainAssociation.js';
|
|
3
|
+
import { type DomainValidation } from './rules.js';
|
|
4
|
+
/**
|
|
5
|
+
* AssociationValidation is a class that performs validation on associations in a data domain.
|
|
6
|
+
* Note that an association in most cases is a property of an entity.
|
|
7
|
+
*/
|
|
8
|
+
export declare class AssociationValidation {
|
|
9
|
+
protected domain: DataDomain;
|
|
10
|
+
constructor(domain: DataDomain);
|
|
11
|
+
/**
|
|
12
|
+
* Performs all the validation rules on the association.
|
|
13
|
+
* If you are interested in a specific rule, use the specific method.
|
|
14
|
+
* @param target The target association to validate. Can be a string with
|
|
15
|
+
* the association key or a DomainAssociation object.
|
|
16
|
+
*/
|
|
17
|
+
validate(target: string | DomainAssociation): DomainValidation[];
|
|
18
|
+
/**
|
|
19
|
+
* Validates the association name.
|
|
20
|
+
*
|
|
21
|
+
* @remarks
|
|
22
|
+
* - A association must have a name defined.
|
|
23
|
+
* - The name has to follow the same rules as the names in a PostgreSQL database.
|
|
24
|
+
* - Column names can only contain letters (a-z, A-Z), numbers (0-9), and underscores (_).
|
|
25
|
+
* - The name must start with a letter (a-z, A-Z) or an underscore (_).
|
|
26
|
+
* - PostgreSQL limits column names to a maximum of 59 characters.
|
|
27
|
+
* - (our rule) Column names are case insensitive.
|
|
28
|
+
* - (recommendation) Column names should be in lower case.
|
|
29
|
+
* @param association The association to validate
|
|
30
|
+
*/
|
|
31
|
+
validateName(association: DomainAssociation): DomainValidation[];
|
|
32
|
+
/**
|
|
33
|
+
* Validates the association targets.
|
|
34
|
+
* @param association The association to validate
|
|
35
|
+
*/
|
|
36
|
+
validateTargets(association: DomainAssociation): DomainValidation[];
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=association_validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"association_validation.d.ts","sourceRoot":"","sources":["../../../../src/modeling/validation/association_validation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAEhE,OAAO,EAAE,KAAK,gBAAgB,EAAwB,MAAM,YAAY,CAAA;AAExE;;;GAGG;AACH,qBAAa,qBAAqB;IACpB,SAAS,CAAC,MAAM,EAAE,UAAU;gBAAlB,MAAM,EAAE,UAAU;IACxC;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,iBAAiB,GAAG,gBAAgB,EAAE;IA6BhE;;;;;;;;;;;;OAYG;IACH,YAAY,CAAC,WAAW,EAAE,iBAAiB,GAAG,gBAAgB,EAAE;IAIhE;;;OAGG;IACH,eAAe,CAAC,WAAW,EAAE,iBAAiB,GAAG,gBAAgB,EAAE;CAwCpE"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { DomainAssociationKind } from '../../models/kinds.js';
|
|
2
|
+
import { validatePropertyName } from './rules.js';
|
|
3
|
+
/**
|
|
4
|
+
* AssociationValidation is a class that performs validation on associations in a data domain.
|
|
5
|
+
* Note that an association in most cases is a property of an entity.
|
|
6
|
+
*/
|
|
7
|
+
export class AssociationValidation {
|
|
8
|
+
domain;
|
|
9
|
+
constructor(domain) {
|
|
10
|
+
this.domain = domain;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Performs all the validation rules on the association.
|
|
14
|
+
* If you are interested in a specific rule, use the specific method.
|
|
15
|
+
* @param target The target association to validate. Can be a string with
|
|
16
|
+
* the association key or a DomainAssociation object.
|
|
17
|
+
*/
|
|
18
|
+
validate(target) {
|
|
19
|
+
const results = [];
|
|
20
|
+
let association;
|
|
21
|
+
if (typeof target === 'string') {
|
|
22
|
+
association = this.domain.findAssociation(target);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
association = target;
|
|
26
|
+
}
|
|
27
|
+
if (!association) {
|
|
28
|
+
const message = `The "${target}" association does not exist.`;
|
|
29
|
+
const help = `The association must be defined in the domain.`;
|
|
30
|
+
results.push({
|
|
31
|
+
field: '*',
|
|
32
|
+
rule: 'exists',
|
|
33
|
+
message,
|
|
34
|
+
help,
|
|
35
|
+
key: target,
|
|
36
|
+
kind: DomainAssociationKind,
|
|
37
|
+
severity: 'error',
|
|
38
|
+
});
|
|
39
|
+
return results;
|
|
40
|
+
}
|
|
41
|
+
const name = this.validateName(association);
|
|
42
|
+
results.push(...name);
|
|
43
|
+
const targets = this.validateTargets(association);
|
|
44
|
+
results.push(...targets);
|
|
45
|
+
return results;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Validates the association name.
|
|
49
|
+
*
|
|
50
|
+
* @remarks
|
|
51
|
+
* - A association must have a name defined.
|
|
52
|
+
* - The name has to follow the same rules as the names in a PostgreSQL database.
|
|
53
|
+
* - Column names can only contain letters (a-z, A-Z), numbers (0-9), and underscores (_).
|
|
54
|
+
* - The name must start with a letter (a-z, A-Z) or an underscore (_).
|
|
55
|
+
* - PostgreSQL limits column names to a maximum of 59 characters.
|
|
56
|
+
* - (our rule) Column names are case insensitive.
|
|
57
|
+
* - (recommendation) Column names should be in lower case.
|
|
58
|
+
* @param association The association to validate
|
|
59
|
+
*/
|
|
60
|
+
validateName(association) {
|
|
61
|
+
return validatePropertyName(association);
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Validates the association targets.
|
|
65
|
+
* @param association The association to validate
|
|
66
|
+
*/
|
|
67
|
+
validateTargets(association) {
|
|
68
|
+
const results = [];
|
|
69
|
+
const label = association.info.getLabel();
|
|
70
|
+
const parentEntity = association.getParentInstance();
|
|
71
|
+
if (!association.targets.length) {
|
|
72
|
+
const message = `The "${label}" association has no target.`;
|
|
73
|
+
const help = `An association must have at least one target.`;
|
|
74
|
+
results.push({
|
|
75
|
+
field: 'targets',
|
|
76
|
+
rule: 'required',
|
|
77
|
+
message,
|
|
78
|
+
help,
|
|
79
|
+
severity: 'error',
|
|
80
|
+
key: association.key,
|
|
81
|
+
kind: association.kind,
|
|
82
|
+
parent: parentEntity.key,
|
|
83
|
+
});
|
|
84
|
+
return results;
|
|
85
|
+
}
|
|
86
|
+
for (const target of association.targets) {
|
|
87
|
+
const entity = target.domain
|
|
88
|
+
? this.domain.findForeignEntity(target.key, target.domain)
|
|
89
|
+
: this.domain.findEntity(target.key);
|
|
90
|
+
if (!entity) {
|
|
91
|
+
const message = `The "${label}" association has an invalid target "${target.key}".`;
|
|
92
|
+
const help = `The target must be defined in the domain.`;
|
|
93
|
+
results.push({
|
|
94
|
+
field: 'targets',
|
|
95
|
+
rule: 'exists',
|
|
96
|
+
message,
|
|
97
|
+
help,
|
|
98
|
+
severity: 'error',
|
|
99
|
+
key: association.key,
|
|
100
|
+
kind: association.kind,
|
|
101
|
+
parent: parentEntity.key,
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return results;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=association_validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"association_validation.js","sourceRoot":"","sources":["../../../../src/modeling/validation/association_validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAI7D,OAAO,EAAyB,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAExE;;;GAGG;AACH,MAAM,OAAO,qBAAqB;IACV;IAAtB,YAAsB,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAC5C;;;;;OAKG;IACH,QAAQ,CAAC,MAAkC;QACzC,MAAM,OAAO,GAAuB,EAAE,CAAA;QACtC,IAAI,WAA0C,CAAA;QAC9C,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;YAC/B,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,MAAM,CAAC,CAAA;QACnD,CAAC;aAAM,CAAC;YACN,WAAW,GAAG,MAAM,CAAA;QACtB,CAAC;QACD,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,MAAM,OAAO,GAAG,QAAQ,MAAM,+BAA+B,CAAA;YAC7D,MAAM,IAAI,GAAG,gDAAgD,CAAA;YAC7D,OAAO,CAAC,IAAI,CAAC;gBACX,KAAK,EAAE,GAAG;gBACV,IAAI,EAAE,QAAQ;gBACd,OAAO;gBACP,IAAI;gBACJ,GAAG,EAAE,MAAgB;gBACrB,IAAI,E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1B,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC;gBAC1D,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;YACtC,IAAI,CAAC,MAAM,EAAE,CAAC;gBACZ,MAAM,OAAO,GAAG,QAAQ,KAAK,wCAAwC,MAAM,CAAC,GAAG,IAAI,CAAA;gBACnF,MAAM,IAAI,GAAG,2CAA2C,CAAA;gBACxD,OAAO,CAAC,IAAI,CAAC;oBACX,KAAK,EAAE,SAAS;oBAChB,IAAI,EAAE,QAAQ;oBACd,OAAO;oBACP,IAAI;oBACJ,QAAQ,EAAE,OAAO;oBACjB,GAAG,EAAE,WAAW,CAAC,GAAG;oBACpB,IAAI,EAAE,WAAW,CAAC,IAAI;oBACtB,MAAM,EAAE,YAAY,CAAC,GAAG;iBACzB,CAAC,CAAA;YACJ,CAAC;QACH,CAAC;QACD,OAAO,OAAO,CAAA;IAChB,CAAC;CACF","sourcesContent":["import { DomainAssociationKind } from '../../models/kinds.js'\nimport type { DataDomain } from '../DataDomain.js'\nimport type { DomainAssociation } from '../DomainAssociation.js'\nimport type { DomainEntity } from '../DomainEntity.js'\nimport { type DomainValidation, validatePropertyName } from './rules.js'\n\n/**\n * AssociationValidation is a class that performs validation on associations in a data domain.\n * Note that an association in most cases is a property of an entity.\n */\nexport class AssociationValidation {\n constructor(protected domain: DataDomain) {}\n /**\n * Performs all the validation rules on the association.\n * If you are interested in a specific rule, use the specific method.\n * @param target The target association to validate. Can be a string with\n * the association key or a DomainAssociation object.\n */\n validate(target: string | DomainAssociation): DomainValidation[] {\n const results: DomainValidation[] = []\n let association: DomainAssociation | undefined\n if (typeof target === 'string') {\n association = this.domain.findAssociation(target)\n } else {\n association = target\n }\n if (!association) {\n const message = `The \"${target}\" association does not exist.`\n const help = `The association must be defined in the domain.`\n results.push({\n field: '*',\n rule: 'exists',\n message,\n help,\n key: target as string,\n kind: DomainAssociationKind,\n severity: 'error',\n })\n return results\n }\n const name = this.validateName(association)\n results.push(...name)\n const targets = this.validateTargets(association)\n results.push(...targets)\n return results\n }\n\n /**\n * Validates the association name.\n *\n * @remarks\n * - A association must have a name defined.\n * - The name has to follow the same rules as the names in a PostgreSQL database.\n * - Column names can only contain letters (a-z, A-Z), numbers (0-9), and underscores (_).\n * - The name must start with a letter (a-z, A-Z) or an underscore (_).\n * - PostgreSQL limits column names to a maximum of 59 characters.\n * - (our rule) Column names are case insensitive.\n * - (recommendation) Column names should be in lower case.\n * @param association The association to validate\n */\n validateName(association: DomainAssociation): DomainValidation[] {\n return validatePropertyName(association)\n }\n\n /**\n * Validates the association targets.\n * @param association The association to validate\n */\n validateTargets(association: DomainAssociation): DomainValidation[] {\n const results: DomainValidation[] = []\n const label = association.info.getLabel()\n const parentEntity = association.getParentInstance() as DomainEntity\n if (!association.targets.length) {\n const message = `The \"${label}\" association has no target.`\n const help = `An association must have at least one target.`\n results.push({\n field: 'targets',\n rule: 'required',\n message,\n help,\n severity: 'error',\n key: association.key,\n kind: association.kind,\n parent: parentEntity.key,\n })\n return results\n }\n for (const target of association.targets) {\n const entity = target.domain\n ? this.domain.findForeignEntity(target.key, target.domain)\n : this.domain.findEntity(target.key)\n if (!entity) {\n const message = `The \"${label}\" association has an invalid target \"${target.key}\".`\n const help = `The target must be defined in the domain.`\n results.push({\n field: 'targets',\n rule: 'exists',\n message,\n help,\n severity: 'error',\n key: association.key,\n kind: association.kind,\n parent: parentEntity.key,\n })\n }\n }\n return results\n }\n}\n"]}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { DataDomain } from '../DataDomain.js';
|
|
2
|
+
import type { DomainEntity } from '../DomainEntity.js';
|
|
3
|
+
import type { DomainValidation } from './rules.js';
|
|
4
|
+
/**
|
|
5
|
+
* EntityValidation is a class that performs validation on entities in a data domain.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* - We do not need to check for parent uniqueness here, because in the graph there can only be one edge
|
|
9
|
+
* between two nodes. Parent relationships are described by an edge in the graph.
|
|
10
|
+
*/
|
|
11
|
+
export declare class EntityValidation {
|
|
12
|
+
protected domain: DataDomain;
|
|
13
|
+
constructor(domain: DataDomain);
|
|
14
|
+
/**
|
|
15
|
+
* Performs all the validation rules on the entity.
|
|
16
|
+
* If you are interested in a specific rule, use the specific method.
|
|
17
|
+
* @param target The target entity to validate. Can be a string with the entity key or a DomainEntity object.
|
|
18
|
+
*/
|
|
19
|
+
validate(target: string | DomainEntity): DomainValidation[];
|
|
20
|
+
/**
|
|
21
|
+
* Validates the entity against the primary key validation rules.
|
|
22
|
+
* @param entity The entity to validate
|
|
23
|
+
* @returns The list of validation messages.
|
|
24
|
+
*/
|
|
25
|
+
validatePrimaryKey(entity: DomainEntity): DomainValidation[];
|
|
26
|
+
/**
|
|
27
|
+
* Checks if the entity has the minimum required properties.
|
|
28
|
+
* @param entity The entity to validate
|
|
29
|
+
*/
|
|
30
|
+
minimumRequiredProperties(entity: DomainEntity): DomainValidation[];
|
|
31
|
+
/**
|
|
32
|
+
* Validates the entity name.
|
|
33
|
+
*
|
|
34
|
+
* @remarks
|
|
35
|
+
* - An entity must have a name defined.
|
|
36
|
+
* - The name has to follow the same rules as the names in a PostgreSQL database.
|
|
37
|
+
* - Table names must start with a letter (a-z) or underscore (_).
|
|
38
|
+
* - Subsequent characters can be letters, digits (0-9), or underscores (_).
|
|
39
|
+
* - Names are case-insensitive.
|
|
40
|
+
* - The maximum length of a table name is 31 characters
|
|
41
|
+
* - Should be snake case (it's a convention, not an error).
|
|
42
|
+
* - Should not be a reserved word (for example: "IN", "SELECT", "FROM", etc.).
|
|
43
|
+
* @param entity The entity to validate
|
|
44
|
+
*/
|
|
45
|
+
validateName(entity: DomainEntity): DomainValidation[];
|
|
46
|
+
/**
|
|
47
|
+
* Checks if the entity name is unique in the data domain.
|
|
48
|
+
* @param entity The entity to validate
|
|
49
|
+
*/
|
|
50
|
+
uniqueName(entity: DomainEntity): DomainValidation[];
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=entity_validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity_validation.d.ts","sourceRoot":"","sources":["../../../../src/modeling/validation/entity_validation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAEtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElD;;;;;;GAMG;AACH,qBAAa,gBAAgB;IACf,SAAS,CAAC,MAAM,EAAE,UAAU;gBAAlB,MAAM,EAAE,UAAU;IAExC;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,gBAAgB,EAAE;IAiC3D;;;;OAIG;IACH,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,gBAAgB,EAAE;IAmB5D;;;OAGG;IACH,yBAAyB,CAAC,MAAM,EAAE,YAAY,GAAG,gBAAgB,EAAE;IAkBnE;;;;;;;;;;;;;OAaG;IACH,YAAY,CAAC,MAAM,EAAE,YAAY,GAAG,gBAAgB,EAAE;IAuFtD;;;OAGG;IACH,UAAU,CAAC,MAAM,EAAE,YAAY,GAAG,gBAAgB,EAAE;CAwCrD"}
|