@api-client/core 0.11.11 → 0.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +7 -4
- 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 +17 -16
- package/build/src/amf/DataValueGenerator.js.map +1 -1
- package/build/src/amf/models/AmfDataNode.d.ts.map +1 -1
- package/build/src/amf/models/AmfDataNode.js +2 -2
- package/build/src/amf/models/AmfDataNode.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/lib/uuid.d.ts +1 -1
- package/build/src/lib/uuid.js +1 -1
- package/build/src/lib/uuid.js.map +1 -1
- package/build/src/mocking/lib/History.js +8 -8
- package/build/src/mocking/lib/History.js.map +1 -1
- package/build/src/mocking/lib/HostRules.js +1 -1
- package/build/src/mocking/lib/HostRules.js.map +1 -1
- package/build/src/mocking/lib/User.js +2 -2
- package/build/src/mocking/lib/User.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 +1141 -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} +11 -8
- 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} +21 -20
- 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} +4 -3
- 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} +9 -8
- 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} +9 -5
- 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} +10 -7
- 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/AuthorizationData.js +3 -3
- package/build/src/models/AuthorizationData.js.map +1 -1
- package/build/src/models/CertificateFile.js +2 -2
- package/build/src/models/CertificateFile.js.map +1 -1
- package/build/src/models/ClientCertificate.js +5 -5
- package/build/src/models/ClientCertificate.js.map +1 -1
- package/build/src/models/Environment.js +6 -6
- package/build/src/models/Environment.js.map +1 -1
- package/build/src/models/Folder.js +2 -2
- package/build/src/models/Folder.js.map +1 -1
- package/build/src/models/HostRule.js +4 -4
- package/build/src/models/HostRule.js.map +1 -1
- package/build/src/models/HttpProject.js +12 -12
- package/build/src/models/HttpProject.js.map +1 -1
- package/build/src/models/Project.d.ts.map +1 -1
- package/build/src/models/Project.js +2 -2
- package/build/src/models/Project.js.map +1 -1
- package/build/src/models/ProjectFolder.d.ts.map +1 -1
- package/build/src/models/ProjectFolder.js +6 -6
- package/build/src/models/ProjectFolder.js.map +1 -1
- package/build/src/models/ProjectRequest.d.ts.map +1 -1
- package/build/src/models/ProjectRequest.js +8 -8
- package/build/src/models/ProjectRequest.js.map +1 -1
- package/build/src/models/ProjectSchema.js +6 -6
- package/build/src/models/ProjectSchema.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 +4 -2
- package/build/src/models/store/DataFile.js.map +1 -1
- package/build/src/models/store/File.d.ts.map +1 -1
- package/build/src/models/store/File.js +3 -3
- package/build/src/models/store/File.js.map +1 -1
- package/build/src/models/store/Organization.js +3 -3
- package/build/src/models/store/Organization.js.map +1 -1
- package/build/src/models/store/Permission.js +7 -7
- package/build/src/models/store/Permission.js.map +1 -1
- package/build/src/models/store/UserIdentity.js +3 -3
- package/build/src/models/store/UserIdentity.js.map +1 -1
- package/build/src/models/transformers/ArcDexieTransformer.js +4 -4
- package/build/src/models/transformers/ArcDexieTransformer.js.map +1 -1
- package/build/src/models/transformers/ArcLegacyTransformer.js +3 -3
- package/build/src/models/transformers/ArcLegacyTransformer.js.map +1 -1
- package/build/src/models/transformers/ArcPouchTransformer.js +2 -2
- package/build/src/models/transformers/ArcPouchTransformer.js.map +1 -1
- package/build/src/models/transformers/PostmanV21Transformer.js +2 -2
- package/build/src/models/transformers/PostmanV21Transformer.js.map +1 -1
- package/build/src/models/transformers/PostmanV2Transformer.js +2 -2
- package/build/src/models/transformers/PostmanV2Transformer.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/patch/PatchClient.js +2 -2
- package/build/src/patch/PatchClient.js.map +1 -1
- 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 +3 -3
- package/build/src/runtime/store/FilesSdk.js.map +1 -1
- package/data/models/example-generator-api.json +8 -8
- package/package.json +20 -6
- package/readme.md +1 -1
- package/src/amf/AmfShapeGenerator.ts +10 -7
- package/src/amf/AmfTypes.ts +2 -2
- package/src/amf/DataValueGenerator.ts +24 -23
- package/src/amf/models/AmfDataNode.ts +2 -2
- 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/lib/uuid.ts +1 -1
- package/src/mocking/lib/History.ts +8 -8
- package/src/mocking/lib/HostRules.ts +1 -1
- package/src/mocking/lib/User.ts +2 -2
- package/src/modeling/Bindings.ts +2 -2
- package/src/modeling/DataDomain.ts +1220 -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} +15 -10
- package/src/modeling/{DataEntity.ts → legacy/DataEntity.ts} +30 -25
- package/src/modeling/{DataEntityBuilder.ts → legacy/DataEntityBuilder.ts} +5 -4
- package/src/modeling/legacy/DataImpactAnalysis.ts +530 -0
- package/src/modeling/{DataModel.ts → legacy/DataModel.ts} +12 -10
- package/src/modeling/{DataNamespace.ts → legacy/DataNamespace.ts} +25 -7
- package/src/modeling/{DataProperty.ts → legacy/DataProperty.ts} +17 -9
- package/src/modeling/observed.ts +267 -0
- package/src/modeling/types.ts +174 -1
- package/src/models/AuthorizationData.ts +3 -3
- package/src/models/CertificateFile.ts +2 -2
- package/src/models/ClientCertificate.ts +5 -5
- package/src/models/Environment.ts +6 -6
- package/src/models/Folder.ts +2 -2
- package/src/models/HostRule.ts +4 -4
- package/src/models/HttpProject.ts +12 -12
- package/src/models/Project.ts +2 -2
- package/src/models/ProjectFolder.ts +6 -6
- package/src/models/ProjectRequest.ts +8 -8
- package/src/models/ProjectSchema.ts +6 -6
- package/src/models/Thing.ts +70 -5
- package/src/models/kinds.ts +32 -6
- package/src/models/store/DataFile.ts +5 -3
- package/src/models/store/File.ts +3 -3
- package/src/models/store/Organization.ts +3 -3
- package/src/models/store/Permission.ts +7 -7
- package/src/models/store/UserIdentity.ts +3 -3
- package/src/models/transformers/ArcDexieTransformer.ts +4 -4
- package/src/models/transformers/ArcLegacyTransformer.ts +3 -3
- package/src/models/transformers/ArcPouchTransformer.ts +2 -2
- package/src/models/transformers/PostmanV21Transformer.ts +2 -2
- package/src/models/transformers/PostmanV2Transformer.ts +2 -2
- package/src/models/types.ts +11 -0
- package/src/patch/PatchClient.ts +2 -2
- package/src/runtime/store/FilesSdk.ts +5 -5
- 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/tests/unit/runtime/proxy/HttpProjectProxy.spec.ts +8 -8
- 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
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
import type { DataDomain } from './DataDomain.js';
|
|
2
|
+
import { DomainAssociationKind } from '../models/kinds.js';
|
|
3
|
+
import { DomainElement, type DomainElementSchema } from './DomainElement.js';
|
|
4
|
+
import { type IThing, Thing } from '../models/Thing.js';
|
|
5
|
+
import type { DomainEntity } from './DomainEntity.js';
|
|
6
|
+
import type { IApiAssociationShape, IApiPropertyShape } from '../amf/definitions/Shapes.js';
|
|
7
|
+
import type { AssociationBinding, AssociationBindings, AssociationWebBindings } from './Bindings.js';
|
|
8
|
+
import { DomainAttributeAttribute } from './DataFormat.js';
|
|
9
|
+
import type { AssociationTarget } from './types.js';
|
|
10
|
+
export interface DomainAssociationSchema extends DomainElementSchema {
|
|
11
|
+
kind: typeof DomainAssociationKind;
|
|
12
|
+
/**
|
|
13
|
+
* The data association description.
|
|
14
|
+
*/
|
|
15
|
+
info: IThing;
|
|
16
|
+
/**
|
|
17
|
+
* Wether the data association is required.
|
|
18
|
+
*/
|
|
19
|
+
required?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Whether the data association allows multiple items.
|
|
22
|
+
*/
|
|
23
|
+
multiple?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* The schema allowing to translate the model into a specific format (like JSON, RAML, XML, etc.)
|
|
26
|
+
*
|
|
27
|
+
* When this is defined then it is used as the schema. When this is not defined it uses
|
|
28
|
+
* referenced entities schemas. Note, changes in the referenced entities may not be propagated
|
|
29
|
+
* to schemas altered by the user.
|
|
30
|
+
*/
|
|
31
|
+
schema?: IApiAssociationShape;
|
|
32
|
+
/**
|
|
33
|
+
* The list of bindings for this property.
|
|
34
|
+
*
|
|
35
|
+
* A binding defines a translation from a data model to a specific format.
|
|
36
|
+
* For example allows to define properties required to generate AMF shape and therefore RAML/OAS shapes for web APIs
|
|
37
|
+
* or a protocol buffer schema.
|
|
38
|
+
*/
|
|
39
|
+
bindings?: AssociationBinding[];
|
|
40
|
+
/**
|
|
41
|
+
* The list of keys associated with the entity through this association.
|
|
42
|
+
* An association without a target is considered invalid and discarded when processing the values.
|
|
43
|
+
* When multiple associations are set then we are dealing with an union.
|
|
44
|
+
*/
|
|
45
|
+
targets?: AssociationTarget[];
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Represents an association between entities in a data domain.
|
|
49
|
+
*
|
|
50
|
+
* A `DomainAssociation` defines a relationship between a
|
|
51
|
+
* `DomainEntity` and one or more other entities. It specifies
|
|
52
|
+
* how entities are connected and can represent various types
|
|
53
|
+
* of relationships, such as one-to-one, one-to-many, or
|
|
54
|
+
* many-to-many.
|
|
55
|
+
*
|
|
56
|
+
* **Key Features:**
|
|
57
|
+
*
|
|
58
|
+
* - **Target Entities:** Specifies the entities that are
|
|
59
|
+
* the target of the association.
|
|
60
|
+
* - **Cardinality:** Defines whether the association is
|
|
61
|
+
* single-valued or multi-valued (e.g., one-to-one vs.
|
|
62
|
+
* one-to-many).
|
|
63
|
+
* - **Required Status:** Indicates whether the association
|
|
64
|
+
* is mandatory or optional.
|
|
65
|
+
* - **Schema Customization:** Allows defining a custom
|
|
66
|
+
* schema for the association, overriding the default
|
|
67
|
+
* schema derived from the target entities.
|
|
68
|
+
* - **Bindings:** Supports defining how the association is
|
|
69
|
+
* represented in different formats (e.g., web APIs,
|
|
70
|
+
* protocol buffers).
|
|
71
|
+
* - **Foreign Namespaces:** Can target entities in other
|
|
72
|
+
* namespaces, enabling cross-namespace relationships.
|
|
73
|
+
*
|
|
74
|
+
* **Usage:**
|
|
75
|
+
*
|
|
76
|
+
* The preferred way to create a `DomainAssociation` is
|
|
77
|
+
* through the `DomainEntity.addAssociation()` method.
|
|
78
|
+
*
|
|
79
|
+
* **Example:**
|
|
80
|
+
*
|
|
81
|
+
* ```typescript
|
|
82
|
+
* const dataDomain = new DataDomain();
|
|
83
|
+
* const userModel = dataDomain.addModel({ key: 'userModel' });
|
|
84
|
+
* const userEntity = userModel.addEntity({ key: 'user' });
|
|
85
|
+
* const addressEntity = userModel.addEntity({ key: 'address' });
|
|
86
|
+
* // Add an association from User to Address
|
|
87
|
+
* const addressAssociation = userEntity.addAssociation();
|
|
88
|
+
* addressAssociation.addTarget(addressEntity);
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
export declare class DomainAssociation extends DomainElement {
|
|
92
|
+
/**
|
|
93
|
+
* The kind of the domain element.
|
|
94
|
+
*/
|
|
95
|
+
kind: typeof DomainAssociationKind;
|
|
96
|
+
/**
|
|
97
|
+
* The description of the association namespace.
|
|
98
|
+
*/
|
|
99
|
+
accessor info: Thing;
|
|
100
|
+
/**
|
|
101
|
+
* Wether the data association is required.
|
|
102
|
+
*/
|
|
103
|
+
accessor required: boolean | undefined;
|
|
104
|
+
/**
|
|
105
|
+
* Whether the data association allows multiple items.
|
|
106
|
+
*/
|
|
107
|
+
accessor multiple: boolean | undefined;
|
|
108
|
+
/**
|
|
109
|
+
* The schema allowing to translate the model into a
|
|
110
|
+
* specific format (like JSON, RAML, XML, etc.)
|
|
111
|
+
*/
|
|
112
|
+
accessor schema: IApiAssociationShape | undefined;
|
|
113
|
+
/**
|
|
114
|
+
* The list of bindings for this property.
|
|
115
|
+
*
|
|
116
|
+
* A binding defines a translation from a data model to a specific format.
|
|
117
|
+
* For example allows to define properties required to generate AMF shape and therefore RAML/OAS shapes for web APIs
|
|
118
|
+
* or a protocol buffer schema.
|
|
119
|
+
*/
|
|
120
|
+
accessor bindings: AssociationBinding[];
|
|
121
|
+
/**
|
|
122
|
+
* The key of the parent entity.
|
|
123
|
+
*/
|
|
124
|
+
protected parent: string;
|
|
125
|
+
/**
|
|
126
|
+
* The list of keys associated with the entity through this association.
|
|
127
|
+
* An association without a target is considered invalid and discarded when processing the values.
|
|
128
|
+
* When multiple associations are set then we are dealing with an union.
|
|
129
|
+
*/
|
|
130
|
+
accessor targets: AssociationTarget[];
|
|
131
|
+
/**
|
|
132
|
+
* Creates a full data association schema with defaults.
|
|
133
|
+
*
|
|
134
|
+
* @param input The partial data association schema.
|
|
135
|
+
* @returns The data association schema.
|
|
136
|
+
*/
|
|
137
|
+
static createSchema(input?: Partial<DomainAssociationSchema>): DomainAssociationSchema;
|
|
138
|
+
/**
|
|
139
|
+
* Creates a new data association instance.
|
|
140
|
+
*
|
|
141
|
+
* You probably want to use the `DomainEntity.addAssociation()` method instead.
|
|
142
|
+
*
|
|
143
|
+
* @param root A reference to the root DataDomain instance.
|
|
144
|
+
* @param parent The key of the parent entity.
|
|
145
|
+
* @param input The partial data association schema.
|
|
146
|
+
*/
|
|
147
|
+
constructor(root: DataDomain, parent: string, input?: Partial<DomainAssociationSchema>);
|
|
148
|
+
/**
|
|
149
|
+
* Generates a JSON representation of the association.
|
|
150
|
+
*
|
|
151
|
+
* @returns A plain object representation of the `DomainAssociation`.
|
|
152
|
+
*/
|
|
153
|
+
toJSON(): DomainAssociationSchema;
|
|
154
|
+
/**
|
|
155
|
+
* Returns a parent data entity where this data property exist.
|
|
156
|
+
*
|
|
157
|
+
* @returns The parent `DomainEntity` or undefined if not found.
|
|
158
|
+
*/
|
|
159
|
+
getParentInstance(): DomainEntity | undefined;
|
|
160
|
+
/**
|
|
161
|
+
* Removes this property from the parent entity.
|
|
162
|
+
*
|
|
163
|
+
* This method removes the association from the parent
|
|
164
|
+
* entity's list of associations.
|
|
165
|
+
*
|
|
166
|
+
* @example
|
|
167
|
+
* ```typescript
|
|
168
|
+
* association.remove();
|
|
169
|
+
* ```
|
|
170
|
+
*/
|
|
171
|
+
remove(): void;
|
|
172
|
+
/**
|
|
173
|
+
* Creates the `schema` object if missing and returns it.
|
|
174
|
+
*
|
|
175
|
+
* @returns The schema object.
|
|
176
|
+
* @example
|
|
177
|
+
* ```typescript
|
|
178
|
+
* const schema = association.ensureSchema();
|
|
179
|
+
* ```
|
|
180
|
+
*/
|
|
181
|
+
ensureSchema(): IApiAssociationShape;
|
|
182
|
+
/**
|
|
183
|
+
* Checks whether the passed value is one of the supported
|
|
184
|
+
* data property attributes.
|
|
185
|
+
*
|
|
186
|
+
* @param value The value to test
|
|
187
|
+
* @returns True when the passed value is one of the
|
|
188
|
+
* supported data property attributes.
|
|
189
|
+
*/
|
|
190
|
+
static isValidAttribute(value: unknown): value is DomainAttributeAttribute;
|
|
191
|
+
/**
|
|
192
|
+
* Creates if not existing and returns web bindings
|
|
193
|
+
* definition.
|
|
194
|
+
*
|
|
195
|
+
* @returns The web binding definition
|
|
196
|
+
* @example
|
|
197
|
+
* ```typescript
|
|
198
|
+
* const webBindings = association.getWebBinding();
|
|
199
|
+
* webBindings.hidden = true;
|
|
200
|
+
* ```
|
|
201
|
+
*/
|
|
202
|
+
getWebBinding(): AssociationWebBindings;
|
|
203
|
+
/**
|
|
204
|
+
* Returns the schema value of the binding, if any was
|
|
205
|
+
* created.
|
|
206
|
+
*
|
|
207
|
+
* @param type The type of the binding to read.
|
|
208
|
+
* @returns The binding schema, if any
|
|
209
|
+
* @example
|
|
210
|
+
* ```typescript
|
|
211
|
+
* const webBindings = association.readBinding('web');
|
|
212
|
+
* if (webBindings) {
|
|
213
|
+
* // ...
|
|
214
|
+
* }
|
|
215
|
+
* ```
|
|
216
|
+
*/
|
|
217
|
+
readBinding(type: 'web' | 'protobuf'): AssociationBindings | undefined;
|
|
218
|
+
/**
|
|
219
|
+
* Adds a target entity to the association.
|
|
220
|
+
*
|
|
221
|
+
* If the entity comes from another namespace then it is
|
|
222
|
+
* set as a foreign entity.
|
|
223
|
+
*
|
|
224
|
+
* @param entity - The `DomainEntity` instance to add.
|
|
225
|
+
* @example
|
|
226
|
+
* ```typescript
|
|
227
|
+
* association.addTarget(addressEntity);
|
|
228
|
+
* ```
|
|
229
|
+
*/
|
|
230
|
+
addTarget(entity: DomainEntity): void;
|
|
231
|
+
/**
|
|
232
|
+
* Adds a target entity to the association.
|
|
233
|
+
*
|
|
234
|
+
* @param entity - The `DomainEntity` definition or just
|
|
235
|
+
* its key.
|
|
236
|
+
* @param namespace - The key of the foreign namespace this
|
|
237
|
+
* entity belongs to. Do not set this value for local
|
|
238
|
+
* entities.
|
|
239
|
+
* @example
|
|
240
|
+
* ```typescript
|
|
241
|
+
* association.addTarget('address', 'foreignNamespace');
|
|
242
|
+
* ```
|
|
243
|
+
*/
|
|
244
|
+
addTarget(entity: string, namespace?: string): void;
|
|
245
|
+
/**
|
|
246
|
+
* Removes a target entity from the targets list.
|
|
247
|
+
*
|
|
248
|
+
* @param init The key of an entity, its instance, or
|
|
249
|
+
* schema.
|
|
250
|
+
* @example
|
|
251
|
+
* ```typescript
|
|
252
|
+
* association.removeTarget(addressEntity);
|
|
253
|
+
* ```
|
|
254
|
+
*/
|
|
255
|
+
removeTarget(init: string | DomainEntity): void;
|
|
256
|
+
/**
|
|
257
|
+
* Lists all target entities of this association.
|
|
258
|
+
*
|
|
259
|
+
* @returns A generator that yields each target
|
|
260
|
+
* `DomainEntity`.
|
|
261
|
+
* @example
|
|
262
|
+
* ```typescript
|
|
263
|
+
* for (const target of association.listTargets()) {
|
|
264
|
+
* console.log(target.key);
|
|
265
|
+
* }
|
|
266
|
+
* ```
|
|
267
|
+
*/
|
|
268
|
+
listTargets(): Generator<DomainEntity>;
|
|
269
|
+
/**
|
|
270
|
+
* Creates a Property Shape of AMF.
|
|
271
|
+
* The property itself is auto-generated. If the `schema` is defined then it is used
|
|
272
|
+
* as the `range` of the property. Otherwise basic shape is generated for the range.
|
|
273
|
+
*
|
|
274
|
+
* This is a preferred way of reading the AMF shape as this synchronizes changed
|
|
275
|
+
* data properties with the shape definition.
|
|
276
|
+
*
|
|
277
|
+
* @returns AMF property shape definition.
|
|
278
|
+
*/
|
|
279
|
+
toApiShape(): IApiPropertyShape;
|
|
280
|
+
}
|
|
281
|
+
//# sourceMappingURL=DomainAssociation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DomainAssociation.d.ts","sourceRoot":"","sources":["../../../src/modeling/DomainAssociation.ts"],"names":[],"mappings":"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"}
|