@api-client/core 0.11.11 → 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 +16 -16
- 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 -2
- 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
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
const reactiveSymbol = Symbol('reactive');
|
|
3
|
+
const proxySymbol = Symbol('proxy');
|
|
4
|
+
/**
|
|
5
|
+
* Reads the raw value of the object, that is, not proxied object.
|
|
6
|
+
* @param source The source object that contains the object
|
|
7
|
+
* @param target The target object set on the source object
|
|
8
|
+
* @returns The not proxied object or undefined
|
|
9
|
+
*/
|
|
10
|
+
export function toRaw(source, target) {
|
|
11
|
+
const proxies = Reflect.get(source, proxySymbol);
|
|
12
|
+
if (!proxies) {
|
|
13
|
+
return undefined;
|
|
14
|
+
}
|
|
15
|
+
for (const [key, value] of proxies.entries()) {
|
|
16
|
+
if (value === target) {
|
|
17
|
+
return key;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Turns a class property or a setter into an observed property
|
|
23
|
+
* that notifies the root domain when changed.
|
|
24
|
+
*
|
|
25
|
+
* A property has to be declared with the `accessor` type to be
|
|
26
|
+
* observed.
|
|
27
|
+
*
|
|
28
|
+
* ```typescript
|
|
29
|
+
* @observed() accessor name: string | undefined
|
|
30
|
+
*
|
|
31
|
+
* @observed()
|
|
32
|
+
* set height(value: number) {
|
|
33
|
+
* this.#height = value
|
|
34
|
+
* }
|
|
35
|
+
*
|
|
36
|
+
* get height(): number {
|
|
37
|
+
* return this.#height
|
|
38
|
+
* }
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* The decorator can be used in the following ways:
|
|
42
|
+
* - As a class property decorator
|
|
43
|
+
* - As a class setter decorator
|
|
44
|
+
*
|
|
45
|
+
* The property class either has to have a `root` property
|
|
46
|
+
* or a `notifyChange` method. The decorator will call the
|
|
47
|
+
* `notifyChange` method if it exists. Otherwise, it will
|
|
48
|
+
* call the `notifyChange` method of the root domain.
|
|
49
|
+
*/
|
|
50
|
+
export function observed(config = {}) {
|
|
51
|
+
return (target, context) => {
|
|
52
|
+
const { kind } = context;
|
|
53
|
+
const { deep } = config;
|
|
54
|
+
function createDeepProxy(obj, notifyChange) {
|
|
55
|
+
if (typeof obj !== 'object' || obj === null) {
|
|
56
|
+
return obj;
|
|
57
|
+
}
|
|
58
|
+
// instead of using the target object to store the proxy info, we
|
|
59
|
+
// reflect the proxy info to the object itself. This way we can
|
|
60
|
+
// keep the stored values clean, which helps with testing (deep equal would include symbols)
|
|
61
|
+
// Keys are original objects, values are proxies
|
|
62
|
+
let proxies = Reflect.get(this, proxySymbol);
|
|
63
|
+
if (!proxies) {
|
|
64
|
+
proxies = new Map();
|
|
65
|
+
Reflect.set(this, proxySymbol, proxies);
|
|
66
|
+
}
|
|
67
|
+
if (proxies.has(obj)) {
|
|
68
|
+
return obj;
|
|
69
|
+
}
|
|
70
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
71
|
+
const targetObject = this;
|
|
72
|
+
const proxy = new Proxy(obj, {
|
|
73
|
+
get(target, prop) {
|
|
74
|
+
const value = Reflect.get(target, prop);
|
|
75
|
+
return createDeepProxy.bind(targetObject)(value, notifyChange);
|
|
76
|
+
},
|
|
77
|
+
set(target, prop, value) {
|
|
78
|
+
const oldValue = Reflect.get(target, prop);
|
|
79
|
+
if (oldValue !== value) {
|
|
80
|
+
Reflect.set(target, prop, value);
|
|
81
|
+
notifyChange();
|
|
82
|
+
}
|
|
83
|
+
return true;
|
|
84
|
+
},
|
|
85
|
+
deleteProperty(target, prop) {
|
|
86
|
+
Reflect.deleteProperty(target, prop);
|
|
87
|
+
notifyChange();
|
|
88
|
+
return true;
|
|
89
|
+
},
|
|
90
|
+
});
|
|
91
|
+
proxies.set(obj, proxy);
|
|
92
|
+
return proxy;
|
|
93
|
+
}
|
|
94
|
+
if (kind === 'accessor') {
|
|
95
|
+
return {
|
|
96
|
+
set(value) {
|
|
97
|
+
let map = Reflect.get(this, reactiveSymbol);
|
|
98
|
+
if (!map) {
|
|
99
|
+
map = {};
|
|
100
|
+
Reflect.set(this, reactiveSymbol, map);
|
|
101
|
+
}
|
|
102
|
+
if (map[context.name] === context.name) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
const notify = () => {
|
|
106
|
+
if (this.domain) {
|
|
107
|
+
this.domain.notifyChange();
|
|
108
|
+
}
|
|
109
|
+
else if (this.notifyChange) {
|
|
110
|
+
this.notifyChange();
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
if (deep) {
|
|
114
|
+
value = createDeepProxy.bind(this)(value, notify);
|
|
115
|
+
}
|
|
116
|
+
if (value === undefined) {
|
|
117
|
+
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
|
|
118
|
+
delete map[context.name];
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
map[context.name] = value;
|
|
122
|
+
}
|
|
123
|
+
notify();
|
|
124
|
+
},
|
|
125
|
+
get() {
|
|
126
|
+
const map = Reflect.get(this, reactiveSymbol) || {};
|
|
127
|
+
return map[context.name];
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
else if (kind === 'setter') {
|
|
132
|
+
const { name } = context;
|
|
133
|
+
return function (value) {
|
|
134
|
+
const oldValue = this[name];
|
|
135
|
+
if (value === oldValue) {
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
const notify = () => {
|
|
139
|
+
if (this.domain) {
|
|
140
|
+
this.domain.notifyChange();
|
|
141
|
+
}
|
|
142
|
+
else if (this.notifyChange) {
|
|
143
|
+
this.notifyChange();
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
target.call(this, value);
|
|
147
|
+
notify();
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
throw new Error(`Unsupported decorator location: ${kind}`);
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* A decorator that can be used to retarget the change event
|
|
155
|
+
* of a property to the root domain.
|
|
156
|
+
*
|
|
157
|
+
* This decorator should not be used with the `observed` decorator.
|
|
158
|
+
* It does the same thing. It will notify about a change to the
|
|
159
|
+
* property itself.
|
|
160
|
+
*/
|
|
161
|
+
export function retargetChange() {
|
|
162
|
+
return (target, context) => {
|
|
163
|
+
const { kind } = context;
|
|
164
|
+
function observer() {
|
|
165
|
+
if (this.domain) {
|
|
166
|
+
this.domain.notifyChange();
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
let binding;
|
|
170
|
+
if (kind === 'accessor') {
|
|
171
|
+
return {
|
|
172
|
+
set(value) {
|
|
173
|
+
let map = Reflect.get(this, reactiveSymbol);
|
|
174
|
+
if (!map) {
|
|
175
|
+
map = {};
|
|
176
|
+
Reflect.set(this, reactiveSymbol, map);
|
|
177
|
+
}
|
|
178
|
+
if (map[context.name] === context.name) {
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
const oldValue = map[context.name];
|
|
182
|
+
if (oldValue === value) {
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
if (value === undefined) {
|
|
186
|
+
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
|
|
187
|
+
delete map[context.name];
|
|
188
|
+
}
|
|
189
|
+
else {
|
|
190
|
+
map[context.name] = value;
|
|
191
|
+
}
|
|
192
|
+
if (oldValue && binding) {
|
|
193
|
+
oldValue.removeEventListener('change', binding);
|
|
194
|
+
}
|
|
195
|
+
if (value) {
|
|
196
|
+
binding = observer.bind(this);
|
|
197
|
+
value.addEventListener('change', binding);
|
|
198
|
+
}
|
|
199
|
+
if (this.domain) {
|
|
200
|
+
this.domain.notifyChange();
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
get() {
|
|
204
|
+
const map = Reflect.get(this, reactiveSymbol) || {};
|
|
205
|
+
return map[context.name];
|
|
206
|
+
},
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
else if (kind === 'setter') {
|
|
210
|
+
const { name } = context;
|
|
211
|
+
return function (value) {
|
|
212
|
+
const oldValue = this[name];
|
|
213
|
+
if (value === oldValue) {
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
;
|
|
217
|
+
target.call(this, value);
|
|
218
|
+
if (oldValue && binding) {
|
|
219
|
+
oldValue.removeEventListener('change', binding);
|
|
220
|
+
}
|
|
221
|
+
if (value) {
|
|
222
|
+
binding = observer.bind(this);
|
|
223
|
+
value.addEventListener('change', binding);
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
throw new Error(`Unsupported decorator location: ${kind}`);
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
//# sourceMappingURL=observed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observed.js","sourceRoot":"","sources":["../../../src/modeling/observed.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,MAAM,cAAc,GAAG,MAAM,CAAC,UAAU,CAAC,CAAA;AACzC,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,CAAA;AA+BnC;;;;;GAKG;AACH,MAAM,UAAU,KAAK,CAA4B,MAAc,EAAE,MAAS;IACxE,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,WAAW,CAAwB,CAAA;IACvE,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;QAC7C,IAAI,KAAK,KAAK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AC","sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nconst reactiveSymbol = Symbol('reactive')\nconst proxySymbol = Symbol('proxy')\n\ninterface DomainInstance {\n domain?: { notifyChange(): void }\n notifyChange?: () => void\n}\n\nexport interface PropertyDecorator {\n // accessor decorator signature\n <C extends DomainInstance, V>(\n target: ClassAccessorDecoratorTarget<C, V>,\n context: ClassAccessorDecoratorContext<C, V>\n ): ClassAccessorDecoratorResult<C, V>\n // setter decorator signature\n <C extends DomainInstance, V>(\n target: (value: V) => void,\n context: ClassSetterDecoratorContext<C, V>\n ): (this: C, value: V) => void\n}\n\ntype StandardPropertyContext<C, V> = ClassAccessorDecoratorContext<C, V> | ClassSetterDecoratorContext<C, V>\ntype StandardPropertyTarget<C, V> = ClassAccessorDecoratorTarget<C, V> | ((value: V) => void)\n\nexport interface ObserveConfig {\n /**\n * To be used when observing an object and not a primitive.\n * It creates a proxy that observes changes in the object.\n */\n deep?: boolean\n}\n\n/**\n * Reads the raw value of the object, that is, not proxied object.\n * @param source The source object that contains the object\n * @param target The target object set on the source object\n * @returns The not proxied object or undefined\n */\nexport function toRaw<T extends object = object>(source: object, target: T): T | undefined {\n const proxies = Reflect.get(source, proxySymbol) as Map<object, object>\n if (!proxies) {\n return undefined\n }\n for (const [key, value] of proxies.entries()) {\n if (value === target) {\n return key as T\n }\n }\n}\n\n/**\n * Turns a class property or a setter into an observed property\n * that notifies the root domain when changed.\n *\n * A property has to be declared with the `accessor` type to be\n * observed.\n *\n * ```typescript\n * @observed() accessor name: string | undefined\n *\n * @observed()\n * set height(value: number) {\n * this.#height = value\n * }\n *\n * get height(): number {\n * return this.#height\n * }\n * ```\n *\n * The decorator can be used in the following ways:\n * - As a class property decorator\n * - As a class setter decorator\n *\n * The property class either has to have a `root` property\n * or a `notifyChange` method. The decorator will call the\n * `notifyChange` method if it exists. Otherwise, it will\n * call the `notifyChange` method of the root domain.\n */\nexport function observed(config: ObserveConfig = {}): PropertyDecorator {\n return <C extends DomainInstance, V>(\n target: StandardPropertyTarget<C, V>,\n context: StandardPropertyContext<C, V>\n ): any => {\n const { kind } = context\n const { deep } = config\n\n function createDeepProxy(this: DomainInstance, obj: unknown, notifyChange: () => void): any {\n if (typeof obj !== 'object' || obj === null) {\n return obj\n }\n // instead of using the target object to store the proxy info, we\n // reflect the proxy info to the object itself. This way we can\n // keep the stored values clean, which helps with testing (deep equal would include symbols)\n // Keys are original objects, values are proxies\n let proxies = Reflect.get(this, proxySymbol) as Map<object, object>\n if (!proxies) {\n proxies = new Map()\n Reflect.set(this, proxySymbol, proxies)\n }\n\n if (proxies.has(obj)) {\n return obj\n }\n\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const targetObject = this\n\n const proxy = new Proxy(obj, {\n get(target, prop) {\n const value = Reflect.get(target, prop)\n return createDeepProxy.bind(targetObject)(value, notifyChange)\n },\n set(target, prop, value) {\n const oldValue = Reflect.get(target, prop)\n if (oldValue !== value) {\n Reflect.set(target, prop, value)\n notifyChange()\n }\n return true\n },\n deleteProperty(target, prop) {\n Reflect.deleteProperty(target, prop)\n notifyChange()\n return true\n },\n })\n proxies.set(obj, proxy)\n return proxy\n }\n\n if (kind === 'accessor') {\n return {\n set(this: DomainInstance, value: V): void {\n let map = Reflect.get(this, reactiveSymbol)\n if (!map) {\n map = {}\n Reflect.set(this, reactiveSymbol, map)\n }\n if (map[context.name] === context.name) {\n return\n }\n const notify = () => {\n if (this.domain) {\n this.domain.notifyChange()\n } else if (this.notifyChange) {\n this.notifyChange()\n }\n }\n if (deep) {\n value = createDeepProxy.bind(this)(value, notify)\n }\n if (value === undefined) {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete map[context.name]\n } else {\n map[context.name] = value\n }\n notify()\n },\n\n get(): V {\n const map = Reflect.get(this, reactiveSymbol) || {}\n return map[context.name]\n },\n }\n } else if (kind === 'setter') {\n const { name } = context\n return function (this: DomainInstance, value: V): void {\n const oldValue = this[name as keyof DomainInstance]\n if (value === oldValue) {\n return\n }\n const notify = () => {\n if (this.domain) {\n this.domain.notifyChange()\n } else if (this.notifyChange) {\n this.notifyChange()\n }\n }\n ;(target as (value: V) => void).call(this, value)\n notify()\n }\n }\n throw new Error(`Unsupported decorator location: ${kind}`)\n }\n}\n\n/**\n * A decorator that can be used to retarget the change event\n * of a property to the root domain.\n *\n * This decorator should not be used with the `observed` decorator.\n * It does the same thing. It will notify about a change to the\n * property itself.\n */\nexport function retargetChange() {\n return <C extends DomainInstance, V extends EventTarget>(\n target: StandardPropertyTarget<C, V>,\n context: StandardPropertyContext<C, V>\n ): any => {\n const { kind } = context\n function observer(this: DomainInstance) {\n if (this.domain) {\n this.domain.notifyChange()\n }\n }\n let binding: ((this: DomainInstance) => void) | undefined\n if (kind === 'accessor') {\n return {\n set(this: DomainInstance, value: V): void {\n let map = Reflect.get(this, reactiveSymbol)\n if (!map) {\n map = {}\n Reflect.set(this, reactiveSymbol, map)\n }\n if (map[context.name] === context.name) {\n return\n }\n const oldValue = map[context.name]\n if (oldValue === value) {\n return\n }\n if (value === undefined) {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete map[context.name]\n } else {\n map[context.name] = value\n }\n if (oldValue && binding) {\n oldValue.removeEventListener('change', binding)\n }\n if (value) {\n binding = observer.bind(this)\n value.addEventListener('change', binding)\n }\n if (this.domain) {\n this.domain.notifyChange()\n }\n },\n\n get(): V {\n const map = Reflect.get(this, reactiveSymbol) || {}\n return map[context.name]\n },\n }\n } else if (kind === 'setter') {\n const { name } = context\n return function (this: DomainInstance, value: V): void {\n const oldValue = this[name as keyof DomainInstance] as unknown as V\n if (value === oldValue) {\n return\n }\n ;(target as (value: V) => void).call(this, value)\n if (oldValue && binding) {\n oldValue.removeEventListener('change', binding)\n }\n if (value) {\n binding = observer.bind(this)\n value.addEventListener('change', binding)\n }\n }\n }\n throw new Error(`Unsupported decorator location: ${kind}`)\n }\n}\n"]}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
+
import type { Graph, GraphJson } from '@api-client/graph';
|
|
2
|
+
import type { DomainAssociation } from './DomainAssociation.js';
|
|
3
|
+
import type { DomainEntity } from './DomainEntity.js';
|
|
4
|
+
import type { DomainModel } from './DomainModel.js';
|
|
5
|
+
import type { DomainNamespace } from './DomainNamespace.js';
|
|
6
|
+
import type { DomainProperty } from './DomainProperty.js';
|
|
1
7
|
export interface DataDomainRemoveOptions {
|
|
2
8
|
/**
|
|
3
|
-
* When true, the object will be
|
|
9
|
+
* When true, the object will be forcibly removed.
|
|
4
10
|
* The resolution defined in the `ImpactResolution` class will be applied.
|
|
5
11
|
*
|
|
6
12
|
* For example, when removing an entity that is a parent to another entity, it will
|
|
@@ -11,4 +17,162 @@ export interface DataDomainRemoveOptions {
|
|
|
11
17
|
*/
|
|
12
18
|
force?: boolean;
|
|
13
19
|
}
|
|
20
|
+
export interface AssociationAddOptions {
|
|
21
|
+
/**
|
|
22
|
+
* When set, it is the the association target's origin data domain.
|
|
23
|
+
* The key of the target data domain where this target entity is defined.
|
|
24
|
+
* Only used when `key` is specified.
|
|
25
|
+
*/
|
|
26
|
+
domain?: string;
|
|
27
|
+
/**
|
|
28
|
+
* The key of the association target, if known.
|
|
29
|
+
* If the target of the association is not specified, and the association has no other targets,
|
|
30
|
+
* the association is ignored in the namespace while processing.
|
|
31
|
+
*/
|
|
32
|
+
key?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface DomainGraphEdge {
|
|
35
|
+
/**
|
|
36
|
+
* Indicates that the edge is to or from a foreign domain.
|
|
37
|
+
*/
|
|
38
|
+
foreign?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* The key of the foreign domain. Always set with the `foreign` property.
|
|
41
|
+
*/
|
|
42
|
+
domain?: string;
|
|
43
|
+
/**
|
|
44
|
+
* The type of the edge.
|
|
45
|
+
* - `association` The edge is to an association object.
|
|
46
|
+
* - When coming **from** an entiry (the `v` property), that entity owns the association.
|
|
47
|
+
* - When coming **to** an entity (the `w` property), that entity is the target of the association.
|
|
48
|
+
* An association can have multiple targets.
|
|
49
|
+
* - `property` The edge is to a property object. Can only be created between an entity and a property.
|
|
50
|
+
* - The **from** (`v`) is the entity.
|
|
51
|
+
* - The **to** (`w`) is the property.
|
|
52
|
+
* - `parent` The edge is to a parent object.
|
|
53
|
+
* - The **from** (`v`) is the child entity.
|
|
54
|
+
* - The **to** (`w`) is the parent entity.
|
|
55
|
+
*/
|
|
56
|
+
type: 'association' | 'property' | 'parent';
|
|
57
|
+
}
|
|
58
|
+
export type DomainGraphNodeType = DomainNamespace | DomainModel | DomainEntity | DomainProperty | DomainAssociation;
|
|
59
|
+
/**
|
|
60
|
+
* An interface that describes the data domain dependency.
|
|
61
|
+
*/
|
|
62
|
+
export interface ForeignDomainDependency {
|
|
63
|
+
/**
|
|
64
|
+
* The system registered key of the foreign domain.
|
|
65
|
+
*/
|
|
66
|
+
key: string;
|
|
67
|
+
/**
|
|
68
|
+
* The version of the foreign domain used in this domain.
|
|
69
|
+
*/
|
|
70
|
+
version: string;
|
|
71
|
+
}
|
|
72
|
+
export interface AssociationTarget {
|
|
73
|
+
/**
|
|
74
|
+
* The key of the target entity.
|
|
75
|
+
*/
|
|
76
|
+
key: string;
|
|
77
|
+
/**
|
|
78
|
+
* The key of the target data domain.
|
|
79
|
+
* This is only set when the target is in a different data domain.
|
|
80
|
+
*/
|
|
81
|
+
domain?: string;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Describes the default value set on a property schema.
|
|
85
|
+
*/
|
|
86
|
+
export interface SchemaDefaultValue {
|
|
87
|
+
/**
|
|
88
|
+
* The type of the default value.
|
|
89
|
+
*
|
|
90
|
+
* - `literal` The `value` should be used as-is.
|
|
91
|
+
* - `function` The value represents the name of the function to be used.
|
|
92
|
+
*/
|
|
93
|
+
type: 'literal' | 'function';
|
|
94
|
+
/**
|
|
95
|
+
* The actual value type depends on the `type`.
|
|
96
|
+
* It is always a string and it has to be casted to the property's data type.
|
|
97
|
+
*/
|
|
98
|
+
value: string;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* A general schema definition for a property.
|
|
102
|
+
* This is propagated to all bindings (when they support these properties).
|
|
103
|
+
*/
|
|
104
|
+
export interface PropertySchema {
|
|
105
|
+
/**
|
|
106
|
+
* The minimum value of the property.
|
|
107
|
+
*
|
|
108
|
+
* By default it is inclusive value. Use the `exclusiveMinimum` property to make it exclusive.
|
|
109
|
+
*
|
|
110
|
+
* Used with:
|
|
111
|
+
* - string
|
|
112
|
+
* - number
|
|
113
|
+
* - date
|
|
114
|
+
* - time
|
|
115
|
+
* - datetime
|
|
116
|
+
*/
|
|
117
|
+
minimum?: number;
|
|
118
|
+
/**
|
|
119
|
+
* The maximum value of the property.
|
|
120
|
+
*
|
|
121
|
+
* By default it is inclusive value. Use the `exclusiveMaximum` property to make it exclusive.
|
|
122
|
+
*
|
|
123
|
+
* Used with:
|
|
124
|
+
* - string
|
|
125
|
+
* - number
|
|
126
|
+
* - date
|
|
127
|
+
* - time
|
|
128
|
+
* - datetime
|
|
129
|
+
*/
|
|
130
|
+
maximum?: number;
|
|
131
|
+
/**
|
|
132
|
+
* When set, the minimum value is exclusive.
|
|
133
|
+
*
|
|
134
|
+
* - When `false`: value ≥ minimum.
|
|
135
|
+
* - When `true`: value > minimum.
|
|
136
|
+
*/
|
|
137
|
+
exclusiveMinimum?: boolean;
|
|
138
|
+
/**
|
|
139
|
+
* When set, the exclusiveMaximum value is exclusive.
|
|
140
|
+
*
|
|
141
|
+
* - When `false`: value ≤ maximum.
|
|
142
|
+
* - When `true`: value < minimum.
|
|
143
|
+
*/
|
|
144
|
+
exclusiveMaximum?: boolean;
|
|
145
|
+
/**
|
|
146
|
+
* The multiplier value for a number scalar.
|
|
147
|
+
*
|
|
148
|
+
* Examples:
|
|
149
|
+
* - if `1` then every integer is allowed
|
|
150
|
+
* - if `2` than every even number is allowed
|
|
151
|
+
* - if `0.5` than every number dividable by `0.5` is allowed
|
|
152
|
+
*/
|
|
153
|
+
multipleOf?: number;
|
|
154
|
+
/**
|
|
155
|
+
* The enum values for the property.
|
|
156
|
+
* They are always encoded as strings. The actual type is defined in the `dataType` property.
|
|
157
|
+
*/
|
|
158
|
+
enum?: string[];
|
|
159
|
+
/**
|
|
160
|
+
* The default value for the property.
|
|
161
|
+
* This is always encoded as a string. The actual type is defined in the `dataType` property.
|
|
162
|
+
*/
|
|
163
|
+
defaultValue?: SchemaDefaultValue;
|
|
164
|
+
/**
|
|
165
|
+
* The example values for the property.
|
|
166
|
+
* They are always encoded as strings. The actual type is defined in the `dataType` property.
|
|
167
|
+
*/
|
|
168
|
+
examples?: string[];
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* The shortcut type for the data domain graph.
|
|
172
|
+
*/
|
|
173
|
+
export type DataDomainGraph = Graph<unknown, DomainGraphNodeType, DomainGraphEdge>;
|
|
174
|
+
/**
|
|
175
|
+
* The serialized version of the data domain graph.
|
|
176
|
+
*/
|
|
177
|
+
export type SerializedGraph = GraphJson<unknown, object, DomainGraphEdge>;
|
|
14
178
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/modeling/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,uBAAuB;IACtC;;;;;;;;;OASG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/modeling/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AACzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAs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OAAO,CAAA;IAC1B;;;;;;;OAOG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;IACf;;;OAGG;IACH,YAAY,CAAC,EAAE,kBAAkB,CAAA;IACjC;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;CACpB;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,EAAE,mBAAmB,EAAE,eAAe,CAAC,CAAA;AAClF;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,eAAe,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/modeling/types.ts"],"names":[],"mappings":"","sourcesContent":["
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/modeling/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Graph, GraphJson } from '@api-client/graph'\nimport type { DomainAssociation } from './DomainAssociation.js'\nimport type { DomainEntity } from './DomainEntity.js'\nimport type { DomainModel } from './DomainModel.js'\nimport type { DomainNamespace } from './DomainNamespace.js'\nimport type { DomainProperty } from './DomainProperty.js'\n\nexport interface DataDomainRemoveOptions {\n /**\n * When true, the object will be forcibly removed.\n * The resolution defined in the `ImpactResolution` class will be applied.\n *\n * For example, when removing an entity that is a parent to another entity, it will\n * removed itself as a parent from the child entity.\n *\n * Note, this option should only be used when the DomainImpactAnalysis has been performed\n * and the user was informed of the impact.\n */\n force?: boolean\n}\n\nexport interface AssociationAddOptions {\n /**\n * When set, it is the the association target's origin data domain.\n * The key of the target data domain where this target entity is defined.\n * Only used when `key` is specified.\n */\n domain?: string\n /**\n * The key of the association target, if known.\n * If the target of the association is not specified, and the association has no other targets,\n * the association is ignored in the namespace while processing.\n */\n key?: string\n}\n\nexport interface DomainGraphEdge {\n /**\n * Indicates that the edge is to or from a foreign domain.\n */\n foreign?: boolean\n /**\n * The key of the foreign domain. Always set with the `foreign` property.\n */\n domain?: string\n /**\n * The type of the edge.\n * - `association` The edge is to an association object.\n * - When coming **from** an entiry (the `v` property), that entity owns the association.\n * - When coming **to** an entity (the `w` property), that entity is the target of the association.\n * An association can have multiple targets.\n * - `property` The edge is to a property object. Can only be created between an entity and a property.\n * - The **from** (`v`) is the entity.\n * - The **to** (`w`) is the property.\n * - `parent` The edge is to a parent object.\n * - The **from** (`v`) is the child entity.\n * - The **to** (`w`) is the parent entity.\n */\n type: 'association' | 'property' | 'parent'\n}\n\nexport type DomainGraphNodeType = DomainNamespace | DomainModel | DomainEntity | DomainProperty | DomainAssociation\n\n/**\n * An interface that describes the data domain dependency.\n */\nexport interface ForeignDomainDependency {\n /**\n * The system registered key of the foreign domain.\n */\n key: string\n /**\n * The version of the foreign domain used in this domain.\n */\n version: string\n}\n\nexport interface AssociationTarget {\n /**\n * The key of the target entity.\n */\n key: string\n /**\n * The key of the target data domain.\n * This is only set when the target is in a different data domain.\n */\n domain?: string\n}\n\n/**\n * Describes the default value set on a property schema.\n */\nexport interface SchemaDefaultValue {\n /**\n * The type of the default value.\n *\n * - `literal` The `value` should be used as-is.\n * - `function` The value represents the name of the function to be used.\n */\n type: 'literal' | 'function'\n /**\n * The actual value type depends on the `type`.\n * It is always a string and it has to be casted to the property's data type.\n */\n value: string\n}\n\n/**\n * A general schema definition for a property.\n * This is propagated to all bindings (when they support these properties).\n */\nexport interface PropertySchema {\n /**\n * The minimum value of the property.\n *\n * By default it is inclusive value. Use the `exclusiveMinimum` property to make it exclusive.\n *\n * Used with:\n * - string\n * - number\n * - date\n * - time\n * - datetime\n */\n minimum?: number\n /**\n * The maximum value of the property.\n *\n * By default it is inclusive value. Use the `exclusiveMaximum` property to make it exclusive.\n *\n * Used with:\n * - string\n * - number\n * - date\n * - time\n * - datetime\n */\n maximum?: number\n /**\n * When set, the minimum value is exclusive.\n *\n * - When `false`: value ≥ minimum.\n * - When `true`: value > minimum.\n */\n exclusiveMinimum?: boolean\n /**\n * When set, the exclusiveMaximum value is exclusive.\n *\n * - When `false`: value ≤ maximum.\n * - When `true`: value < minimum.\n */\n exclusiveMaximum?: boolean\n /**\n * The multiplier value for a number scalar.\n *\n * Examples:\n * - if `1` then every integer is allowed\n * - if `2` than every even number is allowed\n * - if `0.5` than every number dividable by `0.5` is allowed\n */\n multipleOf?: number\n /**\n * The enum values for the property.\n * They are always encoded as strings. The actual type is defined in the `dataType` property.\n */\n enum?: string[]\n /**\n * The default value for the property.\n * This is always encoded as a string. The actual type is defined in the `dataType` property.\n */\n defaultValue?: SchemaDefaultValue\n /**\n * The example values for the property.\n * They are always encoded as strings. The actual type is defined in the `dataType` property.\n */\n examples?: string[]\n}\n\n/**\n * The shortcut type for the data domain graph.\n */\nexport type DataDomainGraph = Graph<unknown, DomainGraphNodeType, DomainGraphEdge>\n/**\n * The serialized version of the data domain graph.\n */\nexport type SerializedGraph = GraphJson<unknown, object, DomainGraphEdge>\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ThingKind } from './kinds.js';
|
|
2
|
+
import { ModelValidationOptions } from './types.js';
|
|
2
3
|
/**
|
|
3
4
|
* An interface describing a base metadata of a thing.
|
|
4
5
|
*/
|
|
@@ -26,36 +27,44 @@ export declare interface IThing {
|
|
|
26
27
|
*/
|
|
27
28
|
version?: string;
|
|
28
29
|
}
|
|
29
|
-
export declare class Thing {
|
|
30
|
+
export declare class Thing extends EventTarget {
|
|
30
31
|
kind: string;
|
|
31
32
|
/**
|
|
32
33
|
* The name of the thing.
|
|
33
34
|
*/
|
|
34
|
-
name
|
|
35
|
+
accessor name: string | undefined;
|
|
35
36
|
/**
|
|
36
37
|
* Optional value to overwrite the `name` in the UI.
|
|
37
38
|
* The primary descriptive field is the `name`. The display name is only used in the presentation of the data.
|
|
38
39
|
*/
|
|
39
|
-
displayName
|
|
40
|
+
accessor displayName: string | undefined;
|
|
40
41
|
/**
|
|
41
42
|
* The description of the thing.
|
|
42
43
|
*/
|
|
43
|
-
description
|
|
44
|
+
accessor description: string | undefined;
|
|
44
45
|
/**
|
|
45
46
|
* The version number of the thing.
|
|
46
47
|
*/
|
|
47
|
-
version
|
|
48
|
+
accessor version: string | undefined;
|
|
48
49
|
/**
|
|
49
50
|
* Returns one in this order:
|
|
50
51
|
* - displayName
|
|
51
52
|
* - name
|
|
52
53
|
* - 'Unnamed object'
|
|
54
|
+
*
|
|
55
|
+
* @deprecated Use `getLabel()` instead.
|
|
53
56
|
*/
|
|
54
57
|
get renderLabel(): string;
|
|
55
58
|
/**
|
|
56
59
|
* Creates a basic description from a name.
|
|
57
60
|
*/
|
|
58
61
|
static fromName(name: string): Thing;
|
|
62
|
+
/**
|
|
63
|
+
* Creates a new thing instance.
|
|
64
|
+
*
|
|
65
|
+
* @param input The thing definition used to restore the state.
|
|
66
|
+
*/
|
|
67
|
+
static fromJSON(input?: Partial<IThing>, defaults?: Partial<IThing>): Thing;
|
|
59
68
|
/**
|
|
60
69
|
* @param input The thing definition used to restore the state.
|
|
61
70
|
*/
|
|
@@ -66,10 +75,22 @@ export declare class Thing {
|
|
|
66
75
|
* Note, this throws an error when the server is not a thing.
|
|
67
76
|
*/
|
|
68
77
|
new(init: IThing): void;
|
|
78
|
+
notifyChange(): void;
|
|
79
|
+
static validate(input: unknown, options?: ModelValidationOptions): boolean;
|
|
69
80
|
/**
|
|
70
81
|
* Checks whether the input is a definition of a server.
|
|
71
82
|
*/
|
|
72
83
|
static isThing(input: unknown): boolean;
|
|
73
84
|
toJSON(): IThing;
|
|
85
|
+
/**
|
|
86
|
+
* Returns one in this order:
|
|
87
|
+
* - `this.displayName`
|
|
88
|
+
* - `this.name`
|
|
89
|
+
* - `defaultName`
|
|
90
|
+
* - 'Unnamed object'
|
|
91
|
+
*
|
|
92
|
+
* @param defaultName The default name to use when no other is available.
|
|
93
|
+
*/
|
|
94
|
+
getLabel(defaultName?: string): string;
|
|
74
95
|
}
|
|
75
96
|
//# sourceMappingURL=Thing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Thing.d.ts","sourceRoot":"","sources":["../../../src/models/Thing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"Thing.d.ts","sourceRoot":"","sources":["../../../src/models/Thing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AACtC,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAA;AAGnD;;GAEG;AACH,MAAM,CAAC,OAAO,WAAW,MAAM;IAC7B;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,SAAS,CAAA;IACvB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,qBAAa,KAAM,SAAQ,WAAW;IACpC,IAAI,SAAY;IAChB;;OAEG;IACS,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;IAC7C;;;OAGG;IACS,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;IACpD;;OAEG;IACS,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;IACpD;;OAEG;IACS,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;IAEhD;;;;;;;OAOG;IACH,IAAI,WAAW,IAAI,MAAM,CAExB;IAED;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK;IAQpC;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,KAAK,GAAE,OAAO,CAAC,MAAM,CAAM,EAAE,QAAQ,GAAE,OAA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