From d86439ce611e3ad66f3733f7a0457177827af542 Mon Sep 17 00:00:00 2001 From: Maeght Loan <37497007+Qypol342@users.noreply.github.com> Date: Wed, 4 Oct 2023 11:40:26 +0000 Subject: [PATCH 1/3] feat: png graph -> mermaid --- docs/internal-model.md | 250 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 244 insertions(+), 6 deletions(-) diff --git a/docs/internal-model.md b/docs/internal-model.md index 1b4d27f3c0..e8924c3923 100644 --- a/docs/internal-model.md +++ b/docs/internal-model.md @@ -19,9 +19,125 @@ These are the meta models and their meaning: - **StringModel** represent string values. - **AnyModel** represent generic values that cannot otherwise be represented by one of the other models. -

- -

+ +```mermaid +--- +title: Meta Model +--- +classDiagram + direction BT + class MetaModel { + <> + String name + Any originalInput + } + + class TupleValueModel{ + <> + Number index + MetaModel value + } + + class TupleModel{ + <> + TupleValueModel[] tupleModels + } + + class ObjectModel{ + <> + String, ObjectPropertyModel properties + } + + class ObjectPropertyModel{ + <> + String propertyName + Boolean required + MetaModel property + } + + class ArrayModel{ + <> + MetaModel valueModel + } + + class UnionModel{ + <> + MetaModel[] unionModels + } + + class EnumValueModel{ + <> + String key + Any value + } + + class EnumModel{ + <> + EnumValueModel[] values + } + + class BooleanModel{ + <> + } + + class StringModel{ + <> + } + + class IntegerModel{ + <> + } + + class FloatModel{ + <> + } + + class AnyModel{ + <> + } + + class ReferencedModel{ + <> + MetaModel referencedModel + } + + class DictionaryModel{ + <> + MetaModel keyModel + MetaModel valueModel + 'unwrap' | 'normanl' serializationType + } + + + + + + TupleValueModel:value --> MetaModel + ObjectPropertyModel:property --> MetaModel + ArrayModel:valueModel --> MetaModel + DictionaryModel:valueModel --> MetaModel + DictionaryModel:keyModel --> MetaModel + + TupleModel "1 ... n" *-- TupleValueModel + ObjectModel "1 ... n" *-- ObjectPropertyModel + UnionModel "1 ... n" *-- "1 ... n" MetaModel + + EnumModel o-- EnumValueModel + + TupleModel --|> MetaModel + ObjectModel --|> MetaModel + ArrayModel --|> MetaModel + UnionModel --|> MetaModel + EnumModel --|> MetaModel + BooleanModel --|> MetaModel + IntegerModel --|> MetaModel + StringModel --|> MetaModel + FloatModel --|> MetaModel + AnyModel --|> MetaModel + ReferencedModel --|> MetaModel + DictionaryModel --|> MetaModel + +``` ## The Constrained Meta Model @@ -35,6 +151,128 @@ How and what are constrained? The answer to this question is not straightforward, cause each output has unique constraints that the meta models must adhere to. You can read more about [the constraint behavior here](constraints.md). -

- -

+```mermaid +--- +title: Constrained Meta Model +--- +classDiagram + direction RL + class MetaModel { + <> + String name + Any originalInput + } + + class ConstrainedMetaModel { + <> + String type + } + + class ConstrainedTupleValueModel{ + <> + Number index + ConstrainedMetaModel value + } + + class ConstrainedTupleModel{ + <> + ConstrainedTupleValueModel[] tupleModels + } + + class ConstrainedObjectModel{ + <> + String, ConstrainedObjectPropertyModel properties + } + + class ConstrainedObjectPropertyModel{ + <> + String propertyName + Boolean required + ConstrainedMetaModel property + } + + class ConstrainedArrayModel{ + <> + ConstrainedMetaModel valueModel + } + + class ConstrainedUnionModel{ + <> + ConstrainedMetaModel[] unionModels + } + + class ConstrainedEnumValueModel{ + <> + String key + Any value + } + + class ConstrainedEnumModel{ + <> + EnumValueModel[] values + } + + class ConstrainedBooleanModel{ + <> + } + + class ConstrainedStringModel{ + <> + } + + class ConstrainedIntegerModel{ + <> + } + + class ConstrainedFloatModel{ + <> + } + + class ConstrainedAnyModel{ + <> + } + + class ConstrainedReferencedModel{ + <> + ConstrainedMetaModel referencedModel + } + + class ConstrainedDictionaryModel{ + <> + ConstrainedMetaModel keyModel + ConstrainedMetaModel valueModel + 'unwrap' | 'normanl' serializationType + } + + + + + + ConstrainedTupleValueModel:value --> ConstrainedMetaModel + ConstrainedObjectPropertyModel:property --> ConstrainedMetaModel + ConstrainedArrayModel:valueModel --> ConstrainedMetaModel + ConstrainedDictionaryModel:valueModel --> ConstrainedMetaModel + ConstrainedDictionaryModel:keyModel --> ConstrainedMetaModel + + ConstrainedTupleModel "1 ... n" *-- ConstrainedTupleValueModel + ConstrainedObjectModel "1 ... n" *-- ConstrainedObjectPropertyModel + ConstrainedUnionModel "1 ... n" *-- "1 ... n" ConstrainedMetaModel + + ConstrainedEnumModel o-- ConstrainedEnumValueModel + + ConstrainedTupleModel --|> ConstrainedMetaModel + ConstrainedObjectModel --|> ConstrainedMetaModel + ConstrainedArrayModel --|> ConstrainedMetaModel + ConstrainedUnionModel --|> ConstrainedMetaModel + ConstrainedEnumModel --|> ConstrainedMetaModel + ConstrainedBooleanModel --|> ConstrainedMetaModel + ConstrainedIntegerModel --|> ConstrainedMetaModel + ConstrainedStringModel --|> ConstrainedMetaModel + ConstrainedFloatModel --|> ConstrainedMetaModel + ConstrainedAnyModel --|> ConstrainedMetaModel + ConstrainedReferencedModel --|> ConstrainedMetaModel + ConstrainedDictionaryModel --|> ConstrainedMetaModel + ConstrainedMetaModel --|> MetaModel + + +``` \ No newline at end of file From b8a2207ac1b5d1a2102d1c135acdf3eed37d03bd Mon Sep 17 00:00:00 2001 From: Maeght Loan <37497007+Qypol342@users.noreply.github.com> Date: Wed, 4 Oct 2023 15:31:47 +0000 Subject: [PATCH 2/3] fix: ObjectModel properties type --- docs/internal-model.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/internal-model.md b/docs/internal-model.md index e8924c3923..8c47b15033 100644 --- a/docs/internal-model.md +++ b/docs/internal-model.md @@ -45,7 +45,7 @@ classDiagram class ObjectModel{ <> - String, ObjectPropertyModel properties + <String, ObjectPropertyModel> properties } class ObjectPropertyModel{ From a6f76fe55772269ca916ac948a4a2d681e9fb2f5 Mon Sep 17 00:00:00 2001 From: Maeght Loan <37497007+Qypol342@users.noreply.github.com> Date: Wed, 4 Oct 2023 15:41:09 +0000 Subject: [PATCH 3/3] fix: ConstrainedObjectModel properties type --- docs/internal-model.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/internal-model.md b/docs/internal-model.md index 8c47b15033..ab8f08e3f1 100644 --- a/docs/internal-model.md +++ b/docs/internal-model.md @@ -181,7 +181,7 @@ classDiagram class ConstrainedObjectModel{ <> - String, ConstrainedObjectPropertyModel properties + <String, ObjectPropertyModel> properties } class ConstrainedObjectPropertyModel{