From 6226997f14cf88d64d007dc21a702bd0d53552f3 Mon Sep 17 00:00:00 2001 From: Sushil Tiwari Date: Thu, 5 Feb 2026 10:38:21 +0545 Subject: [PATCH 1/3] feat(locate): add schema for locate feature tutorial --- .../pyfirebase/pyfirebase_mapswipe/models.py | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/functions/generated/pyfirebase/pyfirebase_mapswipe/models.py b/functions/generated/pyfirebase/pyfirebase_mapswipe/models.py index 81eb479..6955e5c 100644 --- a/functions/generated/pyfirebase/pyfirebase_mapswipe/models.py +++ b/functions/generated/pyfirebase/pyfirebase_mapswipe/models.py @@ -16,7 +16,7 @@ class TypesyncUndefined: def __init__(self): if TypesyncUndefined._instance is not None: raise RuntimeError( - "TypesyncUndefined instances cannot be created directly. Import and use the UNDEFINED sentinel instead.", + "TypesyncUndefined instances cannot be created directly. Import and use the UNDEFINED sentinel instead." ) TypesyncUndefined._instance = self @@ -545,8 +545,7 @@ class FbObjRasterTileServer(TypesyncModel): apiKey: str | TypesyncUndefined | None = UNDEFINED wmtsLayerName: typing.Annotated[ - str | TypesyncUndefined | None, - pydantic.Field(deprecated=True), + str | TypesyncUndefined | None, pydantic.Field(deprecated=True) ] = UNDEFINED credits: str name: FbEnumRasterTileServerName @@ -830,12 +829,10 @@ def __setattr__(self, name: str, value: typing.Any) -> None: class FbBaseTutorial(TypesyncModel): exampleImage1: typing.Annotated[ - str | TypesyncUndefined | None, - pydantic.Field(deprecated=True), + str | TypesyncUndefined | None, pydantic.Field(deprecated=True) ] = UNDEFINED exampleImage2: typing.Annotated[ - str | TypesyncUndefined | None, - pydantic.Field(deprecated=True), + str | TypesyncUndefined | None, pydantic.Field(deprecated=True) ] = UNDEFINED contributorCount: int informationPages: list[FbInformationPage] | TypesyncUndefined | None = UNDEFINED @@ -1167,12 +1164,10 @@ class FbUserReadonlyType(TypesyncModel): created: datetime.datetime lastAppUse: datetime.datetime | TypesyncUndefined | None = UNDEFINED userName: typing.Annotated[ - str | TypesyncUndefined | None, - pydantic.Field(deprecated=True), + str | TypesyncUndefined | None, pydantic.Field(deprecated=True) ] = UNDEFINED userNameKey: typing.Annotated[ - str | TypesyncUndefined | None, - pydantic.Field(deprecated=True), + str | TypesyncUndefined | None, pydantic.Field(deprecated=True) ] = UNDEFINED username: str | TypesyncUndefined | None = UNDEFINED usernameKey: str | TypesyncUndefined | None = UNDEFINED From dd3b4021dae11532ecd1a83ab2c2b7c364e939a8 Mon Sep 17 00:00:00 2001 From: Sushil Tiwari Date: Fri, 20 Feb 2026 16:51:14 +0545 Subject: [PATCH 2/3] feat(locate): create result schema for locate project --- .../project/project_types/locate.yaml | 32 ++++++++++++++ .../pyfirebase/pyfirebase_mapswipe/models.py | 42 ++++++++++++++++--- 2 files changed, 68 insertions(+), 6 deletions(-) diff --git a/functions/definition/project/project_types/locate.yaml b/functions/definition/project/project_types/locate.yaml index 0388f7a..b27970d 100644 --- a/functions/definition/project/project_types/locate.yaml +++ b/functions/definition/project/project_types/locate.yaml @@ -34,3 +34,35 @@ FbProjectLocateCreateOnlyInput: type: string exportMetaValue: type: string + + +FbProjectLocateMappingResult: + model: alias + docs: Represents LOCATE mapswipe project results + # path: results/{projectId}/{groupId}/{userId} + type: + type: object + fields: + appVersion: + type: string + clientType: + # FIXME: this is an enum + type: string + optional: true + endTime: + type: timestamp + startTime: + type: timestamp + results: + optional: true + type: + type: map + valueType: + type: list + elementType: int + usergroups: + optional: true + type: + # NOTE: The key is usergroupId + type: map + valueType: boolean diff --git a/functions/generated/pyfirebase/pyfirebase_mapswipe/models.py b/functions/generated/pyfirebase/pyfirebase_mapswipe/models.py index 6955e5c..2cb28c7 100644 --- a/functions/generated/pyfirebase/pyfirebase_mapswipe/models.py +++ b/functions/generated/pyfirebase/pyfirebase_mapswipe/models.py @@ -16,7 +16,7 @@ class TypesyncUndefined: def __init__(self): if TypesyncUndefined._instance is not None: raise RuntimeError( - "TypesyncUndefined instances cannot be created directly. Import and use the UNDEFINED sentinel instead." + "TypesyncUndefined instances cannot be created directly. Import and use the UNDEFINED sentinel instead.", ) TypesyncUndefined._instance = self @@ -363,6 +363,31 @@ class FBEnumSubGridSize(enum.Enum): SIZE_8X8 = "8x8" +class FbProjectLocateMappingResult(TypesyncModel): + """Represents LOCATE mapswipe project results""" + + appVersion: str + clientType: str | TypesyncUndefined | None = UNDEFINED + endTime: datetime.datetime + startTime: datetime.datetime + results: dict[str, list[int]] | TypesyncUndefined | None = UNDEFINED + usergroups: dict[str, bool] | TypesyncUndefined | None = UNDEFINED + + class Config: + use_enum_values = False + extra = "forbid" + + @typing.override + def __setattr__(self, name: str, value: typing.Any) -> None: + if name == "clientType" and value is None: + raise ValueError("'clientType' field cannot be set to None") + if name == "results" and value is None: + raise ValueError("'results' field cannot be set to None") + if name == "usergroups" and value is None: + raise ValueError("'usergroups' field cannot be set to None") + super().__setattr__(name, value) + + class FbProjectStreetCreateOnlyInput(TypesyncModel): """Represents STREET project fields that are valid while creating a project""" @@ -545,7 +570,8 @@ class FbObjRasterTileServer(TypesyncModel): apiKey: str | TypesyncUndefined | None = UNDEFINED wmtsLayerName: typing.Annotated[ - str | TypesyncUndefined | None, pydantic.Field(deprecated=True) + str | TypesyncUndefined | None, + pydantic.Field(deprecated=True), ] = UNDEFINED credits: str name: FbEnumRasterTileServerName @@ -829,10 +855,12 @@ def __setattr__(self, name: str, value: typing.Any) -> None: class FbBaseTutorial(TypesyncModel): exampleImage1: typing.Annotated[ - str | TypesyncUndefined | None, pydantic.Field(deprecated=True) + str | TypesyncUndefined | None, + pydantic.Field(deprecated=True), ] = UNDEFINED exampleImage2: typing.Annotated[ - str | TypesyncUndefined | None, pydantic.Field(deprecated=True) + str | TypesyncUndefined | None, + pydantic.Field(deprecated=True), ] = UNDEFINED contributorCount: int informationPages: list[FbInformationPage] | TypesyncUndefined | None = UNDEFINED @@ -1164,10 +1192,12 @@ class FbUserReadonlyType(TypesyncModel): created: datetime.datetime lastAppUse: datetime.datetime | TypesyncUndefined | None = UNDEFINED userName: typing.Annotated[ - str | TypesyncUndefined | None, pydantic.Field(deprecated=True) + str | TypesyncUndefined | None, + pydantic.Field(deprecated=True), ] = UNDEFINED userNameKey: typing.Annotated[ - str | TypesyncUndefined | None, pydantic.Field(deprecated=True) + str | TypesyncUndefined | None, + pydantic.Field(deprecated=True), ] = UNDEFINED username: str | TypesyncUndefined | None = UNDEFINED usernameKey: str | TypesyncUndefined | None = UNDEFINED From 2ae12d1dbbe6b6809c8a184bf60239cc02fa271e Mon Sep 17 00:00:00 2001 From: Sushil Tiwari Date: Mon, 9 Mar 2026 11:00:26 +0545 Subject: [PATCH 3/3] chore(pre-commit): exclude uv.lock file formatting --- .pre-commit-config.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2f124bf..451ca82 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,9 +36,11 @@ repos: - id: ruff types_or: [python, pyi, jupyter, toml] args: [--fix, --exit-non-zero-on-fix] + exclude: ^.*uv\.lock$ # Formatter - id: ruff-format types_or: [python, pyi, jupyter, toml] + exclude: ^.*uv\.lock$ - repo: https://github.com/RobertCraigie/pyright-python rev: v1.1.403