@api-client/core 0.11.10 → 0.12.0
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/Testing.md +1 -1
- package/bin/plugins/events/EventPlugin.ts +61 -0
- package/bin/plugins/events/assert.ts +193 -0
- package/bin/plugins/events/types.ts +6 -0
- package/bin/test.ts +8 -1
- package/build/src/amf/AmfShapeGenerator.d.ts +6 -3
- package/build/src/amf/AmfShapeGenerator.d.ts.map +1 -1
- package/build/src/amf/AmfShapeGenerator.js +4 -1
- package/build/src/amf/AmfShapeGenerator.js.map +1 -1
- package/build/src/amf/AmfTypes.d.ts +2 -2
- package/build/src/amf/AmfTypes.d.ts.map +1 -1
- package/build/src/amf/AmfTypes.js.map +1 -1
- package/build/src/amf/DataValueGenerator.d.ts +15 -15
- package/build/src/amf/DataValueGenerator.d.ts.map +1 -1
- package/build/src/amf/DataValueGenerator.js +14 -14
- package/build/src/amf/DataValueGenerator.js.map +1 -1
- package/build/src/browser.d.ts +12 -9
- package/build/src/browser.d.ts.map +1 -1
- package/build/src/browser.js +11 -8
- package/build/src/browser.js.map +1 -1
- package/build/src/exceptions/attach_exception.d.ts +11 -0
- package/build/src/exceptions/attach_exception.d.ts.map +1 -0
- package/build/src/exceptions/attach_exception.js +11 -0
- package/build/src/exceptions/attach_exception.js.map +1 -0
- package/build/src/exceptions/detach_exception.d.ts +11 -0
- package/build/src/exceptions/detach_exception.d.ts.map +1 -0
- package/build/src/exceptions/detach_exception.js +11 -0
- package/build/src/exceptions/detach_exception.js.map +1 -0
- package/build/src/exceptions/remove_model_exception.d.ts +8 -0
- package/build/src/exceptions/remove_model_exception.d.ts.map +1 -0
- package/build/src/exceptions/remove_model_exception.js +8 -0
- package/build/src/exceptions/remove_model_exception.js.map +1 -0
- package/build/src/exceptions/remove_namespace_exception.d.ts +8 -0
- package/build/src/exceptions/remove_namespace_exception.d.ts.map +1 -0
- package/build/src/exceptions/remove_namespace_exception.js +8 -0
- package/build/src/exceptions/remove_namespace_exception.js.map +1 -0
- package/build/src/index.d.ts +12 -9
- package/build/src/index.d.ts.map +1 -1
- package/build/src/index.js +11 -8
- package/build/src/index.js.map +1 -1
- package/build/src/legacy.d.ts +8 -0
- package/build/src/legacy.d.ts.map +1 -1
- package/build/src/legacy.js +9 -0
- package/build/src/legacy.js.map +1 -1
- package/build/src/modeling/Bindings.d.ts +2 -2
- package/build/src/modeling/Bindings.d.ts.map +1 -1
- package/build/src/modeling/Bindings.js.map +1 -1
- package/build/src/modeling/DataDomain.d.ts +601 -0
- package/build/src/modeling/DataDomain.d.ts.map +1 -0
- package/build/src/modeling/DataDomain.js +1142 -0
- package/build/src/modeling/DataDomain.js.map +1 -0
- package/build/src/modeling/DataFormat.d.ts +42 -41
- package/build/src/modeling/DataFormat.d.ts.map +1 -1
- package/build/src/modeling/DataFormat.js +30 -131
- package/build/src/modeling/DataFormat.js.map +1 -1
- package/build/src/modeling/DomainAssociation.d.ts +281 -0
- package/build/src/modeling/DomainAssociation.d.ts.map +1 -0
- package/build/src/modeling/DomainAssociation.js +440 -0
- package/build/src/modeling/DomainAssociation.js.map +1 -0
- package/build/src/modeling/DomainElement.d.ts +33 -0
- package/build/src/modeling/DomainElement.d.ts.map +1 -0
- package/build/src/modeling/DomainElement.js +32 -0
- package/build/src/modeling/DomainElement.js.map +1 -0
- package/build/src/modeling/DomainEntity.d.ts +383 -0
- package/build/src/modeling/DomainEntity.d.ts.map +1 -0
- package/build/src/modeling/DomainEntity.js +718 -0
- package/build/src/modeling/DomainEntity.js.map +1 -0
- package/build/src/modeling/DomainFile.d.ts +25 -0
- package/build/src/modeling/DomainFile.d.ts.map +1 -0
- package/build/src/modeling/DomainFile.js +86 -0
- package/build/src/modeling/DomainFile.js.map +1 -0
- package/build/src/modeling/DomainImpactAnalysis.d.ts +60 -47
- package/build/src/modeling/DomainImpactAnalysis.d.ts.map +1 -1
- package/build/src/modeling/DomainImpactAnalysis.js +201 -132
- package/build/src/modeling/DomainImpactAnalysis.js.map +1 -1
- package/build/src/modeling/DomainModel.d.ts +226 -0
- package/build/src/modeling/DomainModel.d.ts.map +1 -0
- package/build/src/modeling/DomainModel.js +401 -0
- package/build/src/modeling/DomainModel.js.map +1 -0
- package/build/src/modeling/DomainNamespace.d.ts +268 -0
- package/build/src/modeling/DomainNamespace.d.ts.map +1 -0
- package/build/src/modeling/DomainNamespace.js +512 -0
- package/build/src/modeling/DomainNamespace.js.map +1 -0
- package/build/src/modeling/DomainProperty.d.ts +281 -0
- package/build/src/modeling/DomainProperty.d.ts.map +1 -0
- package/build/src/modeling/DomainProperty.js +560 -0
- package/build/src/modeling/DomainProperty.js.map +1 -0
- package/build/src/modeling/DomainSerialization.d.ts +40 -0
- package/build/src/modeling/DomainSerialization.d.ts.map +1 -0
- package/build/src/modeling/DomainSerialization.js +288 -0
- package/build/src/modeling/DomainSerialization.js.map +1 -0
- package/build/src/modeling/DomainVersioning.d.ts +17 -0
- package/build/src/modeling/DomainVersioning.d.ts.map +1 -0
- package/build/src/modeling/DomainVersioning.js +124 -0
- package/build/src/modeling/DomainVersioning.js.map +1 -0
- package/build/src/modeling/GraphUtils.d.ts +8 -0
- package/build/src/modeling/GraphUtils.d.ts.map +1 -0
- package/build/src/modeling/GraphUtils.js +26 -0
- package/build/src/modeling/GraphUtils.js.map +1 -0
- package/build/src/modeling/amf/ShapeGenerator.d.ts +164 -0
- package/build/src/modeling/amf/ShapeGenerator.d.ts.map +1 -0
- package/build/src/modeling/amf/ShapeGenerator.js +492 -0
- package/build/src/modeling/amf/ShapeGenerator.js.map +1 -0
- package/build/src/modeling/{DataAssociation.d.ts → legacy/DataAssociation.d.ts} +10 -5
- package/build/src/modeling/legacy/DataAssociation.d.ts.map +1 -0
- package/build/src/modeling/{DataAssociation.js → legacy/DataAssociation.js} +9 -6
- package/build/src/modeling/legacy/DataAssociation.js.map +1 -0
- package/build/src/modeling/{DataEntity.d.ts → legacy/DataEntity.d.ts} +12 -7
- package/build/src/modeling/legacy/DataEntity.d.ts.map +1 -0
- package/build/src/modeling/{DataEntity.js → legacy/DataEntity.js} +19 -18
- package/build/src/modeling/legacy/DataEntity.js.map +1 -0
- package/build/src/modeling/{DataEntityBuilder.d.ts → legacy/DataEntityBuilder.d.ts} +3 -2
- package/build/src/modeling/legacy/DataEntityBuilder.d.ts.map +1 -0
- package/build/src/modeling/{DataEntityBuilder.js → legacy/DataEntityBuilder.js} +3 -2
- package/build/src/modeling/legacy/DataEntityBuilder.js.map +1 -0
- package/build/src/modeling/legacy/DataImpactAnalysis.d.ts +298 -0
- package/build/src/modeling/legacy/DataImpactAnalysis.d.ts.map +1 -0
- package/build/src/modeling/legacy/DataImpactAnalysis.js +441 -0
- package/build/src/modeling/legacy/DataImpactAnalysis.js.map +1 -0
- package/build/src/modeling/{DataModel.d.ts → legacy/DataModel.d.ts} +6 -4
- package/build/src/modeling/legacy/DataModel.d.ts.map +1 -0
- package/build/src/modeling/{DataModel.js → legacy/DataModel.js} +7 -6
- package/build/src/modeling/legacy/DataModel.js.map +1 -0
- package/build/src/modeling/{DataNamespace.d.ts → legacy/DataNamespace.d.ts} +22 -3
- package/build/src/modeling/legacy/DataNamespace.d.ts.map +1 -0
- package/build/src/modeling/{DataNamespace.js → legacy/DataNamespace.js} +7 -3
- package/build/src/modeling/legacy/DataNamespace.js.map +1 -0
- package/build/src/modeling/{DataProperty.d.ts → legacy/DataProperty.d.ts} +13 -5
- package/build/src/modeling/legacy/DataProperty.d.ts.map +1 -0
- package/build/src/modeling/{DataProperty.js → legacy/DataProperty.js} +8 -5
- package/build/src/modeling/legacy/DataProperty.js.map +1 -0
- package/build/src/modeling/observed.d.ts +67 -0
- package/build/src/modeling/observed.d.ts.map +1 -0
- package/build/src/modeling/observed.js +230 -0
- package/build/src/modeling/observed.js.map +1 -0
- package/build/src/modeling/types.d.ts +165 -1
- package/build/src/modeling/types.d.ts.map +1 -1
- package/build/src/modeling/types.js.map +1 -1
- package/build/src/models/Thing.d.ts +26 -5
- package/build/src/models/Thing.d.ts.map +1 -1
- package/build/src/models/Thing.js +193 -91
- package/build/src/models/Thing.js.map +1 -1
- package/build/src/models/kinds.d.ts +31 -6
- package/build/src/models/kinds.d.ts.map +1 -1
- package/build/src/models/kinds.js +31 -6
- package/build/src/models/kinds.js.map +1 -1
- package/build/src/models/store/DataFile.d.ts +3 -1
- package/build/src/models/store/DataFile.d.ts.map +1 -1
- package/build/src/models/store/DataFile.js +2 -0
- package/build/src/models/store/DataFile.js.map +1 -1
- package/build/src/models/types.d.ts +12 -0
- package/build/src/models/types.d.ts.map +1 -0
- package/build/src/models/types.js +2 -0
- package/build/src/models/types.js.map +1 -0
- package/build/src/runtime/store/FilesSdk.d.ts +2 -2
- package/build/src/runtime/store/FilesSdk.d.ts.map +1 -1
- package/build/src/runtime/store/FilesSdk.js.map +1 -1
- package/data/models/example-generator-api.json +26 -26
- package/package.json +20 -6
- package/readme.md +1 -1
- package/src/amf/AmfShapeGenerator.ts +7 -4
- package/src/amf/AmfTypes.ts +2 -2
- package/src/amf/DataValueGenerator.ts +21 -21
- package/src/exceptions/attach_exception.ts +11 -0
- package/src/exceptions/detach_exception.ts +11 -0
- package/src/exceptions/remove_model_exception.ts +8 -0
- package/src/exceptions/remove_namespace_exception.ts +8 -0
- package/src/modeling/Bindings.ts +2 -2
- package/src/modeling/DataDomain.ts +1221 -0
- package/src/modeling/DataFormat.ts +54 -163
- package/src/modeling/DomainAssociation.ts +476 -0
- package/src/modeling/DomainElement.ts +50 -0
- package/src/modeling/DomainEntity.ts +769 -0
- package/src/modeling/DomainFile.ts +94 -0
- package/src/modeling/DomainImpactAnalysis.ts +218 -144
- package/src/modeling/DomainModel.ts +421 -0
- package/src/modeling/DomainNamespace.ts +537 -0
- package/src/modeling/DomainProperty.ts +548 -0
- package/src/modeling/DomainSerialization.ts +312 -0
- package/src/modeling/DomainVersioning.ts +144 -0
- package/src/modeling/GraphUtils.ts +28 -0
- package/src/modeling/amf/ShapeGenerator.ts +552 -0
- package/src/modeling/graph.md +115 -0
- package/src/modeling/{DataAssociation.ts → legacy/DataAssociation.ts} +13 -8
- package/src/modeling/{DataEntity.ts → legacy/DataEntity.ts} +28 -23
- package/src/modeling/{DataEntityBuilder.ts → legacy/DataEntityBuilder.ts} +4 -3
- package/src/modeling/legacy/DataImpactAnalysis.ts +530 -0
- package/src/modeling/{DataModel.ts → legacy/DataModel.ts} +10 -8
- package/src/modeling/{DataNamespace.ts → legacy/DataNamespace.ts} +23 -5
- package/src/modeling/{DataProperty.ts → legacy/DataProperty.ts} +15 -7
- package/src/modeling/observed.ts +267 -0
- package/src/modeling/types.ts +174 -1
- package/src/models/Thing.ts +70 -5
- package/src/models/kinds.ts +32 -6
- package/src/models/store/DataFile.ts +3 -1
- package/src/models/types.ts +11 -0
- package/src/runtime/store/FilesSdk.ts +2 -6
- package/tests/unit/amf/data_value_generator.spec.ts +15 -15
- package/tests/unit/legacy-transformers/ARC-legacy-import.spec.ts +1 -1
- package/tests/unit/modeling/amf/shape_generator.spec.ts +1174 -0
- package/tests/unit/modeling/data_domain.spec.ts +444 -0
- package/tests/unit/modeling/data_domain_associations.spec.ts +279 -0
- package/tests/unit/modeling/data_domain_change_observers.spec.ts +681 -0
- package/tests/unit/modeling/data_domain_entities.spec.ts +449 -0
- package/tests/unit/modeling/data_domain_foreign.spec.ts +355 -0
- package/tests/unit/modeling/data_domain_models.spec.ts +658 -0
- package/tests/unit/modeling/data_domain_namespaces.spec.ts +668 -0
- package/tests/unit/modeling/data_domain_property.spec.ts +264 -0
- package/tests/unit/modeling/data_domain_serialization.spec.ts +294 -0
- package/tests/unit/modeling/domain.property.spec.ts +822 -0
- package/tests/unit/modeling/domain_asociation.spec.ts +643 -0
- package/tests/unit/modeling/domain_asociation_targets.spec.ts +350 -0
- package/tests/unit/modeling/domain_entity.spec.ts +730 -0
- package/tests/unit/modeling/domain_entity_associations.spec.ts +330 -0
- package/tests/unit/modeling/domain_entity_example_generator_json.spec.ts +988 -0
- package/tests/unit/modeling/domain_entity_example_generator_xml.spec.ts +1451 -0
- package/tests/unit/modeling/domain_entity_fields.spec.ts +113 -0
- package/tests/unit/modeling/domain_entity_generators.spec.ts +20 -0
- package/tests/unit/modeling/domain_entity_parents.spec.ts +291 -0
- package/tests/unit/modeling/domain_entity_properties.spec.ts +305 -0
- package/tests/unit/modeling/{data_file.spec.ts → domain_file.spec.ts} +29 -85
- package/tests/unit/modeling/domain_impact_analysis.spec.ts +452 -0
- package/tests/unit/modeling/domain_model.spec.ts +568 -0
- package/tests/unit/modeling/domain_model_entities.spec.ts +408 -0
- package/tests/unit/modeling/domain_namespace.spec.ts +514 -0
- package/tests/unit/modeling/domain_namespace_models.spec.ts +324 -0
- package/tests/unit/modeling/domain_namespace_namespaces.spec.ts +404 -0
- package/tests/unit/modeling/domain_versioning.spec.ts +140 -0
- package/tests/unit/{amf → modeling/legacy}/amf_shape_generator.spec.ts +11 -11
- package/tests/unit/modeling/{data_association.spec.ts → legacy/data_association.spec.ts} +3 -11
- package/tests/unit/modeling/{data_entity.spec.ts → legacy/data_entity.spec.ts} +10 -8
- package/tests/unit/modeling/{data_entity_generator_json.spec.ts → legacy/data_entity_generator_json.spec.ts} +1 -1
- package/tests/unit/modeling/{data_entity_generator_xml.spec.ts → legacy/data_entity_generator_xml.spec.ts} +1 -1
- package/tests/unit/modeling/{data_model.spec.ts → legacy/data_model.spec.ts} +3 -3
- package/tests/unit/modeling/{data_namespace.spec.ts → legacy/data_namespace.spec.ts} +3 -10
- package/tests/unit/modeling/{data_property.spec.ts → legacy/data_property.spec.ts} +3 -6
- package/tests/unit/modeling/{impact_analysis.spec.ts → legacy/impact_analysis.spec.ts} +9 -9
- package/tests/unit/models/File/new.spec.ts +1 -1
- package/tests/unit/models/HttpProject.spec.ts +3 -3
- package/tsconfig.node.json +35 -0
- package/build/src/modeling/DataAssociation.d.ts.map +0 -1
- package/build/src/modeling/DataAssociation.js.map +0 -1
- package/build/src/modeling/DataEntity.d.ts.map +0 -1
- package/build/src/modeling/DataEntity.js.map +0 -1
- package/build/src/modeling/DataEntityBuilder.d.ts.map +0 -1
- package/build/src/modeling/DataEntityBuilder.js.map +0 -1
- package/build/src/modeling/DataModel.d.ts.map +0 -1
- package/build/src/modeling/DataModel.js.map +0 -1
- package/build/src/modeling/DataNamespace.d.ts.map +0 -1
- package/build/src/modeling/DataNamespace.js.map +0 -1
- package/build/src/modeling/DataProperty.d.ts.map +0 -1
- package/build/src/modeling/DataProperty.js.map +0 -1
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { Json } from '@api-client/json'
|
|
2
|
-
import { AmfShapeGenerator } from '
|
|
3
|
-
import { IApiAssociationShape, IApiPropertyShape } from '
|
|
4
|
-
import v4 from '
|
|
5
|
-
import { IThing, Thing } from '
|
|
2
|
+
import { AmfShapeGenerator } from '../../amf/AmfShapeGenerator.js'
|
|
3
|
+
import { IApiAssociationShape, IApiPropertyShape } from '../../amf/definitions/Shapes.js'
|
|
4
|
+
import v4 from '../../lib/uuid.js'
|
|
5
|
+
import { IThing, Thing } from '../../models/Thing.js'
|
|
6
6
|
import { DataEntity, IDataEntity } from './DataEntity.js'
|
|
7
7
|
import { DataNamespace } from './DataNamespace.js'
|
|
8
|
-
import { type FieldValidationMessage, ValidationError } from '
|
|
9
|
-
import { DataAssociationKind } from '
|
|
10
|
-
import type { AssociationBinding, AssociationBindings, AssociationWebBindings } from '
|
|
11
|
-
import { DataAttributeAttributes, type DataAttributeAttribute } from '
|
|
8
|
+
import { type FieldValidationMessage, ValidationError } from '../../exceptions/validation_error.js'
|
|
9
|
+
import { DataAssociationKind } from '../../models/kinds.js'
|
|
10
|
+
import type { AssociationBinding, AssociationBindings, AssociationWebBindings } from '../Bindings.js'
|
|
11
|
+
import { DataAttributeAttributes, type DataAttributeAttribute } from '../DataFormat.js'
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Describes association target of an entity
|
|
15
|
+
* @deprecated
|
|
15
16
|
*/
|
|
16
17
|
export interface AssociationTarget {
|
|
17
18
|
/**
|
|
@@ -36,6 +37,7 @@ export interface AssociationTarget {
|
|
|
36
37
|
*
|
|
37
38
|
* Depending on the schema translation an association can be embedded as a sub-object in the generated schema
|
|
38
39
|
* or can be references via a primary key.
|
|
40
|
+
* @deprecated
|
|
39
41
|
*/
|
|
40
42
|
export interface IDataAssociation {
|
|
41
43
|
kind: typeof DataAssociationKind
|
|
@@ -115,6 +117,7 @@ export interface IDataAssociation {
|
|
|
115
117
|
*
|
|
116
118
|
* - **Hidden**:
|
|
117
119
|
* - `hidden`: (boolean) Defines if this association is a part of the schema or not.
|
|
120
|
+
* @deprecated
|
|
118
121
|
*/
|
|
119
122
|
export class DataAssociation {
|
|
120
123
|
kind = DataAssociationKind
|
|
@@ -283,6 +286,7 @@ export class DataAssociation {
|
|
|
283
286
|
*
|
|
284
287
|
* @param input The object to validate.
|
|
285
288
|
* @throws {ValidationError} When the validation fails.
|
|
289
|
+
* @deprecated
|
|
286
290
|
*/
|
|
287
291
|
static validate(input: unknown): void {
|
|
288
292
|
const typed = input as IDataAssociation
|
|
@@ -496,6 +500,7 @@ export class DataAssociation {
|
|
|
496
500
|
* Checks whether the passed value is one of the supported data property attributes.
|
|
497
501
|
* @param value The value to test
|
|
498
502
|
* @returns True when the passed value is one of the supported data property attributes.
|
|
503
|
+
* @deprecated
|
|
499
504
|
*/
|
|
500
505
|
static isValidAttribute(value: unknown): value is DataAttributeAttribute {
|
|
501
506
|
if (typeof value !== 'string') {
|
|
@@ -1,23 +1,26 @@
|
|
|
1
|
-
import { IThing, Thing } from '
|
|
2
|
-
import v4 from '
|
|
1
|
+
import { IThing, Thing } from '../../models/Thing.js'
|
|
2
|
+
import v4 from '../../lib/uuid.js'
|
|
3
3
|
import { DataNamespace } from './DataNamespace.js'
|
|
4
4
|
import { DataProperty } from './DataProperty.js'
|
|
5
|
-
import { type DataPropertyType } from '
|
|
5
|
+
import { type DataPropertyType } from '../DataFormat.js'
|
|
6
6
|
import { DataAssociation } from './DataAssociation.js'
|
|
7
|
-
import { FileBreadcrumb } from '
|
|
8
|
-
import { DataEntityKind } from '
|
|
7
|
+
import { FileBreadcrumb } from '../../models/store/File.js'
|
|
8
|
+
import { DataEntityKind } from '../../models/kinds.js'
|
|
9
9
|
import { DataModel } from './DataModel.js'
|
|
10
|
-
import { IApiNodeShape, IShapeUnion } from '
|
|
11
|
-
import { AmfShapeGenerator } from '
|
|
12
|
-
import { ApiSchemaGenerator } from '
|
|
13
|
-
import { IShapeRenderOptions } from '
|
|
14
|
-
import { RemovePropertyException } from '
|
|
15
|
-
import { RemoveAssociationException } from '
|
|
16
|
-
import { ValidationError, type FieldValidationMessage } from '
|
|
17
|
-
import { RemoveEntityException } from '
|
|
18
|
-
import { ForeignAssociationException } from '
|
|
19
|
-
import type { DataDomainRemoveOptions } from '
|
|
10
|
+
import { IApiNodeShape, IShapeUnion } from '../../amf/definitions/Shapes.js'
|
|
11
|
+
import { AmfShapeGenerator } from '../../amf/AmfShapeGenerator.js'
|
|
12
|
+
import { ApiSchemaGenerator } from '../../amf/ApiSchemaGenerator.js'
|
|
13
|
+
import { IShapeRenderOptions } from '../../amf/shape/ShapeBase.js'
|
|
14
|
+
import { RemovePropertyException } from '../../exceptions/remove_property_exception.js'
|
|
15
|
+
import { RemoveAssociationException } from '../../exceptions/remove_association_exception.js'
|
|
16
|
+
import { ValidationError, type FieldValidationMessage } from '../../exceptions/validation_error.js'
|
|
17
|
+
import { RemoveEntityException } from '../../exceptions/remove_entity_exception.js'
|
|
18
|
+
import { ForeignAssociationException } from '../../exceptions/foreign_association_exception.js'
|
|
19
|
+
import type { DataDomainRemoveOptions } from '../types.js'
|
|
20
20
|
|
|
21
|
+
/**
|
|
22
|
+
* @deprecated
|
|
23
|
+
*/
|
|
21
24
|
interface OrderedItem {
|
|
22
25
|
/**
|
|
23
26
|
* The type of the ordered item.
|
|
@@ -32,6 +35,7 @@ interface OrderedItem {
|
|
|
32
35
|
/**
|
|
33
36
|
* Data entity is the smallest description of a data in the system
|
|
34
37
|
* It contains properties and associations. At least one entity describe a data model.
|
|
38
|
+
* @deprecated
|
|
35
39
|
*/
|
|
36
40
|
export interface IDataEntity {
|
|
37
41
|
kind: typeof DataEntityKind
|
|
@@ -102,6 +106,7 @@ export interface IDataEntity {
|
|
|
102
106
|
/**
|
|
103
107
|
* Data entity is the smallest description of a data in the system
|
|
104
108
|
* It contains properties and associations. At least one entity describe a data model.
|
|
109
|
+
* @deprecated
|
|
105
110
|
*/
|
|
106
111
|
export class DataEntity {
|
|
107
112
|
kind = DataEntityKind
|
|
@@ -603,9 +608,9 @@ export class DataEntity {
|
|
|
603
608
|
item.removeAssociation(association.key)
|
|
604
609
|
})
|
|
605
610
|
} else {
|
|
606
|
-
const entitiesNames = result.map(({ entity }) => entity.info.
|
|
611
|
+
const entitiesNames = result.map(({ entity }) => entity.info.getLabel(entity.key))
|
|
607
612
|
throw new RemoveEntityException(
|
|
608
|
-
`Cannot remove entity ${this.info.
|
|
613
|
+
`Cannot remove entity ${this.info.getLabel()} because it is used as a target in associations in entities: ${entitiesNames.join(', ')}.`
|
|
609
614
|
)
|
|
610
615
|
}
|
|
611
616
|
}
|
|
@@ -617,9 +622,9 @@ export class DataEntity {
|
|
|
617
622
|
child.parents = child.parents.filter((i) => i !== this.key)
|
|
618
623
|
})
|
|
619
624
|
} else {
|
|
620
|
-
const childrenNames = children.map((i) => i.info.
|
|
625
|
+
const childrenNames = children.map((i) => i.info.getLabel(i.key))
|
|
621
626
|
throw new RemoveEntityException(
|
|
622
|
-
`Cannot remove entity ${this.info.
|
|
627
|
+
`Cannot remove entity ${this.info.getLabel()} because it is a parent for the following entities: ${childrenNames.join(', ')}.`
|
|
623
628
|
)
|
|
624
629
|
}
|
|
625
630
|
}
|
|
@@ -868,7 +873,7 @@ export class DataEntity {
|
|
|
868
873
|
const result: FileBreadcrumb[] = []
|
|
869
874
|
result.push({
|
|
870
875
|
key: this.key,
|
|
871
|
-
name: this.info.
|
|
876
|
+
name: this.info.getLabel('Unnamed entity'),
|
|
872
877
|
kind: DataEntityKind,
|
|
873
878
|
})
|
|
874
879
|
const model = this.getParentInstance()
|
|
@@ -876,21 +881,21 @@ export class DataEntity {
|
|
|
876
881
|
result.push({
|
|
877
882
|
key: model.key,
|
|
878
883
|
kind: model.kind,
|
|
879
|
-
name: model.info.
|
|
884
|
+
name: model.info.getLabel('Unnamed model'),
|
|
880
885
|
})
|
|
881
886
|
let parent = model.getParentInstance()
|
|
882
887
|
while (parent && parent !== this.root) {
|
|
883
888
|
result.push({
|
|
884
889
|
key: parent.key,
|
|
885
890
|
kind: parent.kind,
|
|
886
|
-
name: parent.info.
|
|
891
|
+
name: parent.info.getLabel('Unnamed namespace'),
|
|
887
892
|
})
|
|
888
893
|
parent = parent.getParentInstance()
|
|
889
894
|
}
|
|
890
895
|
}
|
|
891
896
|
result.push({
|
|
892
897
|
key: this.root.key,
|
|
893
|
-
name: this.root.info.
|
|
898
|
+
name: this.root.info.getLabel('Unnamed data domain'),
|
|
894
899
|
kind: this.root.kind,
|
|
895
900
|
})
|
|
896
901
|
return result.reverse()
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { DataEntity } from './DataEntity.js'
|
|
2
2
|
import { DataNamespace } from './DataNamespace.js'
|
|
3
|
-
import { type DataPropertyType } from '
|
|
4
|
-
import { type IThing, Thing } from '
|
|
5
|
-
import v4 from '
|
|
3
|
+
import { type DataPropertyType } from '../DataFormat.js'
|
|
4
|
+
import { type IThing, Thing } from '../../models/Thing.js'
|
|
5
|
+
import v4 from '../../lib/uuid.js'
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* A fluent builder for constructing `DataEntity` instances.
|
|
@@ -43,6 +43,7 @@ import v4 from '../lib/uuid.js'
|
|
|
43
43
|
* .addParent(baseEntity.key)
|
|
44
44
|
* .build()
|
|
45
45
|
* ```
|
|
46
|
+
* @deprecated
|
|
46
47
|
*/
|
|
47
48
|
export class DataEntityBuilder {
|
|
48
49
|
private entity: DataEntity
|