diff --git a/functions/definition/tutorial/common.yaml b/functions/definition/tutorial/common.yaml index eda0b68..0f09ea9 100644 --- a/functions/definition/tutorial/common.yaml +++ b/functions/definition/tutorial/common.yaml @@ -104,6 +104,10 @@ FbBaseTutorial: tutorialDraftId: type: string deprecated: true + screens: + type: + type: list + elementType: FbScreen FbBaseTutorialGroup: model: alias diff --git a/functions/definition/tutorial/compare.yaml b/functions/definition/tutorial/compare.yaml index 23e3312..d464505 100644 --- a/functions/definition/tutorial/compare.yaml +++ b/functions/definition/tutorial/compare.yaml @@ -15,48 +15,12 @@ FbCompareTutorial: type: FbObjRasterTileServer zoomLevel: type: int - screens: - type: - type: list - elementType: FbScreen - -FbCompareTutorialGroup: - model: alias - type: - type: object - fields: - xMax: - type: int - xMin: - type: int - yMax: - type: int - yMin: - type: int FbCompareTutorialTask: model: alias type: type: object fields: - geometry: # NOTE: initially empty string - type: string - groupId: - type: int - projectId: - type: string - referenceAnswer: - type: int - screen: - type: int - taskId: - type: string - taskId_real: - type: string - taskX: - type: int - taskY: - type: int url: type: string urlB: diff --git a/functions/definition/tutorial/completeness.yaml b/functions/definition/tutorial/completeness.yaml index 8d35f3c..e6d8a6f 100644 --- a/functions/definition/tutorial/completeness.yaml +++ b/functions/definition/tutorial/completeness.yaml @@ -17,48 +17,12 @@ FbCompletenessTutorial: type: FbObjUnifiedOverlayTileServer zoomLevel: type: int - screens: - type: - type: list - elementType: FbScreen - -FbCompletenessTutorialGroup: - model: alias - type: - type: object - fields: - xMax: - type: int - xMin: - type: int - yMax: - type: int - yMin: - type: int FbCompletenessTutorialTask: model: alias type: type: object fields: - geometry: # NOTE: initially empty string - type: string - groupId: - type: int - projectId: - type: string - referenceAnswer: - type: int - screen: - type: int - taskId: - type: string - taskId_real: - type: string - taskX: - type: int - taskY: - type: int url: type: string urlB: diff --git a/functions/definition/tutorial/find.yaml b/functions/definition/tutorial/find.yaml index 12e0400..5dbbff7 100644 --- a/functions/definition/tutorial/find.yaml +++ b/functions/definition/tutorial/find.yaml @@ -13,47 +13,11 @@ FbFindTutorial: type: FbObjRasterTileServer zoomLevel: type: int - screens: - type: - type: list - elementType: FbScreen - -FbFindTutorialGroup: - model: alias - type: - type: object - fields: - xMax: - type: int - xMin: - type: int - yMax: - type: int - yMin: - type: int FbFindTutorialTask: model: alias type: type: object fields: - geometry: # NOTE: initially empty string - type: string - groupId: - type: int - projectId: - type: string - referenceAnswer: - type: int - screen: - type: int - taskId: - type: string - taskId_real: - type: string - taskX: - type: int - taskY: - type: int url: type: string diff --git a/functions/definition/tutorial/tileMapService.yaml b/functions/definition/tutorial/tileMapService.yaml new file mode 100644 index 0000000..7e7eb9f --- /dev/null +++ b/functions/definition/tutorial/tileMapService.yaml @@ -0,0 +1,37 @@ +FbTileMapServiceTutorialGroup: + model: alias + type: + type: object + fields: + xMax: + type: int + xMin: + type: int + yMax: + type: int + yMin: + type: int + +FbTileMapServiceTutorialTask: + model: alias + type: + type: object + fields: + geometry: # NOTE: initially empty string + type: string + groupId: + type: int + projectId: + type: string + referenceAnswer: + type: int + screen: + type: int + taskId: + type: string + taskId_real: + type: string + taskX: + type: int + taskY: + type: int diff --git a/functions/definition/tutorial/validate.yaml b/functions/definition/tutorial/validate.yaml index dff1523..7ee771d 100644 --- a/functions/definition/tutorial/validate.yaml +++ b/functions/definition/tutorial/validate.yaml @@ -5,8 +5,10 @@ FbValidateTutorial: type: type: object fields: - inputGeometries: # NOTE: local path to geometry file + # NOTE: local path to geometry file + inputGeometries: type: string + deprecated: true projectType: type: type: literal @@ -15,10 +17,7 @@ FbValidateTutorial: type: FbObjRasterTileServer zoomLevel: type: int - screens: - type: - type: list - elementType: FbScreen + deprecated: true customOptions: optional: true type: @@ -30,14 +29,12 @@ FbValidateTutorialTaskProperties: type: type: object fields: - building: - type: string - description: - type: string - reference: - type: string # NOTE: not sure if this is int or string + id: + type: int screen: - type: string # NOTE: not sure if this is int or string + type: int + reference: + type: int FbValidateTutorialTask: model: alias @@ -50,9 +47,5 @@ FbValidateTutorialTask: type: unknown properties: type: FbValidateTutorialTaskProperties - screen: - type: int - reference: - type: int geometry: # NOTE: geometry as WKT type: string diff --git a/functions/generated/pyfirebase/pyfirebase_mapswipe/extended_models.py b/functions/generated/pyfirebase/pyfirebase_mapswipe/extended_models.py index 46adfaa..6f04f84 100644 --- a/functions/generated/pyfirebase/pyfirebase_mapswipe/extended_models.py +++ b/functions/generated/pyfirebase/pyfirebase_mapswipe/extended_models.py @@ -14,9 +14,7 @@ class FbProject( class Config: # type: ignore[reportIncompatibleVariableOverride] use_enum_values = False frozen = True - # NOTE: We need to allow extra fields as FbProject - # is not a complete project representation - extra = "allow" + extra = "forbid" class FbMappingGroup( @@ -48,3 +46,33 @@ class Config: # type: ignore[reportIncompatibleVariableOverride] use_enum_values = False frozen = True extra = "forbid" + + +class FbFindTutorialTaskComplete( + models.FbTileMapServiceTutorialTask, + models.FbFindTutorialTask, +): + class Config: # type: ignore[reportIncompatibleVariableOverride] + use_enum_values = True + frozen = True + extra = "forbid" + + +class FbCompareTutorialTaskComplete( + models.FbTileMapServiceTutorialTask, + models.FbCompareTutorialTask, +): + class Config: # type: ignore[reportIncompatibleVariableOverride] + use_enum_values = True + frozen = True + extra = "forbid" + + +class FbCompletenessTutorialTaskComplete( + models.FbTileMapServiceTutorialTask, + models.FbCompletenessTutorialTask, +): + class Config: # type: ignore[reportIncompatibleVariableOverride] + use_enum_values = True + frozen = True + extra = "forbid" diff --git a/functions/generated/pyfirebase/pyfirebase_mapswipe/models.py b/functions/generated/pyfirebase/pyfirebase_mapswipe/models.py index e684d4a..a5817e7 100644 --- a/functions/generated/pyfirebase/pyfirebase_mapswipe/models.py +++ b/functions/generated/pyfirebase/pyfirebase_mapswipe/models.py @@ -733,6 +733,7 @@ class FbBaseTutorial(TypesyncModel): projectTopicKey: typing.Annotated[str, pydantic.Field(deprecated=True)] status: typing.Literal["tutorial"] tutorialDraftId: typing.Annotated[str, pydantic.Field(deprecated=True)] + screens: list[FbScreen] class Config: use_enum_values = False @@ -769,22 +770,6 @@ class FbCompareTutorial(TypesyncModel): tileServer: FbObjRasterTileServer tileServerB: FbObjRasterTileServer zoomLevel: int - screens: list[FbScreen] - - class Config: - use_enum_values = False - extra = "forbid" - - @typing.override - def __setattr__(self, name: str, value: typing.Any) -> None: - super().__setattr__(name, value) - - -class FbCompareTutorialGroup(TypesyncModel): - xMax: int - xMin: int - yMax: int - yMin: int class Config: use_enum_values = False @@ -796,15 +781,6 @@ def __setattr__(self, name: str, value: typing.Any) -> None: class FbCompareTutorialTask(TypesyncModel): - geometry: str - groupId: int - projectId: str - referenceAnswer: int - screen: int - taskId: str - taskId_real: str - taskX: int - taskY: int url: str urlB: str @@ -823,7 +799,6 @@ class FbCompletenessTutorial(TypesyncModel): tileServerB: FbObjRasterTileServer overlayTileServer: FbObjUnifiedOverlayTileServer zoomLevel: int - screens: list[FbScreen] class Config: use_enum_values = False @@ -834,11 +809,9 @@ def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) -class FbCompletenessTutorialGroup(TypesyncModel): - xMax: int - xMin: int - yMax: int - yMin: int +class FbCompletenessTutorialTask(TypesyncModel): + url: str + urlB: str class Config: use_enum_values = False @@ -849,18 +822,10 @@ def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) -class FbCompletenessTutorialTask(TypesyncModel): - geometry: str - groupId: int - projectId: str - referenceAnswer: int - screen: int - taskId: str - taskId_real: str - taskX: int - taskY: int - url: str - urlB: str +class FbFindTutorial(TypesyncModel): + projectType: typing.Literal[1] + tileServer: FbObjRasterTileServer + zoomLevel: int class Config: use_enum_values = False @@ -871,11 +836,8 @@ def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) -class FbFindTutorial(TypesyncModel): - projectType: typing.Literal[1] - tileServer: FbObjRasterTileServer - zoomLevel: int - screens: list[FbScreen] +class FbFindTutorialTask(TypesyncModel): + url: str class Config: use_enum_values = False @@ -886,7 +848,7 @@ def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) -class FbFindTutorialGroup(TypesyncModel): +class FbTileMapServiceTutorialGroup(TypesyncModel): xMax: int xMin: int yMax: int @@ -901,7 +863,7 @@ def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) -class FbFindTutorialTask(TypesyncModel): +class FbTileMapServiceTutorialTask(TypesyncModel): geometry: str groupId: int projectId: str @@ -911,7 +873,6 @@ class FbFindTutorialTask(TypesyncModel): taskId_real: str taskX: int taskY: int - url: str class Config: use_enum_values = False @@ -923,11 +884,10 @@ def __setattr__(self, name: str, value: typing.Any) -> None: class FbValidateTutorial(TypesyncModel): - inputGeometries: str + inputGeometries: typing.Annotated[str, pydantic.Field(deprecated=True)] projectType: typing.Literal[2] tileServer: FbObjRasterTileServer - zoomLevel: int - screens: list[FbScreen] + zoomLevel: typing.Annotated[int, pydantic.Field(deprecated=True)] customOptions: list[FbObjCustomOption] | TypesyncUndefined | None = UNDEFINED class Config: @@ -942,10 +902,9 @@ def __setattr__(self, name: str, value: typing.Any) -> None: class FbValidateTutorialTaskProperties(TypesyncModel): - building: str - description: str - reference: str - screen: str + id: int + screen: int + reference: int class Config: use_enum_values = False @@ -960,8 +919,6 @@ class FbValidateTutorialTask(TypesyncModel): taskId: str geojson: typing.Any properties: FbValidateTutorialTaskProperties - screen: int - reference: int geometry: str class Config: