diff --git a/opengeodeweb_back_schemas.json b/opengeodeweb_back_schemas.json index 89fad98e..db78688d 100644 --- a/opengeodeweb_back_schemas.json +++ b/opengeodeweb_back_schemas.json @@ -438,8 +438,8 @@ "title": "MeshComponent", "type": "object", "properties": { - "viewer_id": { - "title": "ViewerId", + "block_id": { + "title": "BlockId", "type": "integer" }, "geode_id": { @@ -477,7 +477,7 @@ } }, "required": [ - "viewer_id", + "block_id", "geode_id", "name", "type", @@ -689,8 +689,8 @@ "title": "MeshComponent", "type": "object", "properties": { - "viewer_id": { - "title": "ViewerId", + "block_id": { + "title": "BlockId", "type": "integer" }, "geode_id": { @@ -728,7 +728,7 @@ } }, "required": [ - "viewer_id", + "block_id", "geode_id", "name", "type", @@ -931,8 +931,8 @@ "title": "MeshComponent", "type": "object", "properties": { - "viewer_id": { - "title": "ViewerId", + "block_id": { + "title": "BlockId", "type": "integer" }, "geode_id": { @@ -970,7 +970,7 @@ } }, "required": [ - "viewer_id", + "block_id", "geode_id", "name", "type", @@ -1195,8 +1195,8 @@ "title": "MeshComponent", "type": "object", "properties": { - "viewer_id": { - "title": "ViewerId", + "block_id": { + "title": "BlockId", "type": "integer" }, "geode_id": { @@ -1234,7 +1234,7 @@ } }, "required": [ - "viewer_id", + "block_id", "geode_id", "name", "type", @@ -2330,8 +2330,8 @@ "title": "MeshComponent", "type": "object", "properties": { - "viewer_id": { - "title": "ViewerId", + "block_id": { + "title": "BlockId", "type": "integer" }, "geode_id": { @@ -2369,7 +2369,7 @@ } }, "required": [ - "viewer_id", + "block_id", "geode_id", "name", "type", diff --git a/opengeodeweb_back_typed_schemas.d.ts b/opengeodeweb_back_typed_schemas.d.ts index 8dcc3f2b..9d798d93 100644 --- a/opengeodeweb_back_typed_schemas.d.ts +++ b/opengeodeweb_back_typed_schemas.d.ts @@ -2,7 +2,7 @@ import type json from "./opengeodeweb_back_schemas.json"; import type { DataId, GeodeId } from "@geode/opengeodeweb-microservice/schema_types"; -import type { AttributeInfo, AttributeName, CRS, CollectionComponent, Filename, MeshComponent, Point3D, ViewerId } from "@geode/opengeodeweb-back/schema_types"; +import type { AttributeInfo, AttributeName, BlockId, CRS, CollectionComponent, Filename, MeshComponent, Point3D } from "@geode/opengeodeweb-back/schema_types"; import type { GeodeObjectType, ViewerObjectType } from "@geode/opengeodeweb-microservice/data_types"; export interface BasemapDeleteParams { diff --git a/requirements.txt b/requirements.txt index 9e2f1942..597e5178 100644 --- a/requirements.txt +++ b/requirements.txt @@ -84,4 +84,3 @@ werkzeug==3.1.8 # flask # flask-cors -opengeodeweb-microservice==1.*,>=1.5.1 diff --git a/src/opengeodeweb_back/routes/create/schemas/edged_curve.py b/src/opengeodeweb_back/routes/create/schemas/edged_curve.py index fb16e388..8dc6bdfe 100644 --- a/src/opengeodeweb_back/routes/create/schemas/edged_curve.py +++ b/src/opengeodeweb_back/routes/create/schemas/edged_curve.py @@ -1,5 +1,5 @@ from opengeodeweb_microservice.schema_types import DataId, GeodeId -from opengeodeweb_back.schema_types import CRS, CollectionComponent, MeshComponent, Point3D, ViewerId +from opengeodeweb_back.schema_types import BlockId, CRS, CollectionComponent, MeshComponent, Point3D from opengeodeweb_microservice.database.data_types import GeodeObjectType, ViewerObjectType from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema diff --git a/src/opengeodeweb_back/routes/create/schemas/horizon_stack.py b/src/opengeodeweb_back/routes/create/schemas/horizon_stack.py index d446c63c..706304d5 100644 --- a/src/opengeodeweb_back/routes/create/schemas/horizon_stack.py +++ b/src/opengeodeweb_back/routes/create/schemas/horizon_stack.py @@ -1,5 +1,5 @@ from opengeodeweb_microservice.schema_types import DataId, GeodeId -from opengeodeweb_back.schema_types import CRS, CollectionComponent, MeshComponent, ViewerId +from opengeodeweb_back.schema_types import BlockId, CRS, CollectionComponent, MeshComponent from opengeodeweb_microservice.database.data_types import GeodeObjectType, ViewerObjectType from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema diff --git a/src/opengeodeweb_back/routes/create/schemas/point_set.py b/src/opengeodeweb_back/routes/create/schemas/point_set.py index e0af2779..58144e73 100644 --- a/src/opengeodeweb_back/routes/create/schemas/point_set.py +++ b/src/opengeodeweb_back/routes/create/schemas/point_set.py @@ -1,5 +1,5 @@ from opengeodeweb_microservice.schema_types import DataId, GeodeId -from opengeodeweb_back.schema_types import CRS, CollectionComponent, MeshComponent, Point3D, ViewerId +from opengeodeweb_back.schema_types import BlockId, CRS, CollectionComponent, MeshComponent, Point3D from opengeodeweb_microservice.database.data_types import GeodeObjectType, ViewerObjectType from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema diff --git a/src/opengeodeweb_back/routes/create/schemas/polygonal_surface.py b/src/opengeodeweb_back/routes/create/schemas/polygonal_surface.py index bcb9c117..fba97aa8 100644 --- a/src/opengeodeweb_back/routes/create/schemas/polygonal_surface.py +++ b/src/opengeodeweb_back/routes/create/schemas/polygonal_surface.py @@ -1,5 +1,5 @@ from opengeodeweb_microservice.schema_types import DataId, GeodeId -from opengeodeweb_back.schema_types import CRS, CollectionComponent, MeshComponent, Point3D, ViewerId +from opengeodeweb_back.schema_types import BlockId, CRS, CollectionComponent, MeshComponent, Point3D from opengeodeweb_microservice.database.data_types import GeodeObjectType, ViewerObjectType from pathlib import Path from opengeodeweb_microservice.schemas import Route, load_schema diff --git a/src/opengeodeweb_back/routes/schemas/save_viewable_file.py b/src/opengeodeweb_back/routes/schemas/save_viewable_file.py index 2db115e7..bcea892d 100644 --- a/src/opengeodeweb_back/routes/schemas/save_viewable_file.py +++ b/src/opengeodeweb_back/routes/schemas/save_viewable_file.py @@ -1,4 +1,4 @@ -from opengeodeweb_back.schema_types import CRS, CollectionComponent, Filename, MeshComponent, ViewerId +from opengeodeweb_back.schema_types import BlockId, CRS, CollectionComponent, Filename, MeshComponent from opengeodeweb_microservice.schema_types import DataId, GeodeId from opengeodeweb_microservice.database.data_types import GeodeObjectType, ViewerObjectType from pathlib import Path diff --git a/src/opengeodeweb_back/schema_definitions.json b/src/opengeodeweb_back/schema_definitions.json index 0a04f5b7..a0567aaa 100644 --- a/src/opengeodeweb_back/schema_definitions.json +++ b/src/opengeodeweb_back/schema_definitions.json @@ -32,6 +32,9 @@ "type": "string", "minLength": 1 }, + "BlockId": { + "type": "integer" + }, "CRS": { "type": "object", "properties": { @@ -216,8 +219,8 @@ "MeshComponent": { "type": "object", "properties": { - "viewer_id": { - "title": "ViewerId", + "block_id": { + "title": "BlockId", "type": "integer" }, "geode_id": { @@ -255,7 +258,7 @@ } }, "required": [ - "viewer_id", + "block_id", "geode_id", "name", "type", @@ -295,9 +298,6 @@ "default" ] }, - "ViewerId": { - "type": "integer" - }, "ViewerObjectType": { "type": "string", "enum": [ diff --git a/src/opengeodeweb_back/schema_types.d.ts b/src/opengeodeweb_back/schema_types.d.ts index 7cc8de14..712502dd 100644 --- a/src/opengeodeweb_back/schema_types.d.ts +++ b/src/opengeodeweb_back/schema_types.d.ts @@ -1,6 +1,6 @@ // Generated by generate_schema_types.js from schema_types.json: do not edit -export type ViewerId = number; +export type BlockId = number; export type AttributeName = string; export type Filename = string; @@ -26,13 +26,13 @@ export interface CRS { } export interface MeshComponent { + block_id: BlockId; boundaries: GeodeId[]; geode_id: GeodeId; internals: GeodeId[]; is_active: boolean; name: string; type: string; - viewer_id: ViewerId; } export interface CollectionComponent { diff --git a/src/opengeodeweb_back/schema_types.json b/src/opengeodeweb_back/schema_types.json index a9c7bc50..f59b3599 100644 --- a/src/opengeodeweb_back/schema_types.json +++ b/src/opengeodeweb_back/schema_types.json @@ -1,5 +1,5 @@ { - "ViewerId": { + "BlockId": { "type": "integer" }, "AttributeName": { @@ -83,8 +83,8 @@ "MeshComponent": { "type": "object", "properties": { - "viewer_id": { - "title": "ViewerId" + "block_id": { + "title": "BlockId" }, "geode_id": { "title": "GeodeId" @@ -112,7 +112,7 @@ } }, "required": [ - "viewer_id", + "block_id", "geode_id", "name", "type", diff --git a/src/opengeodeweb_back/schema_types.py b/src/opengeodeweb_back/schema_types.py index 8a4cce59..166b4ac9 100644 --- a/src/opengeodeweb_back/schema_types.py +++ b/src/opengeodeweb_back/schema_types.py @@ -8,7 +8,7 @@ from opengeodeweb_microservice.schema_types import GeodeId from opengeodeweb_microservice.schemas import print_dataclass -ViewerId = int +BlockId = int AttributeName = str Filename = str @@ -49,13 +49,13 @@ class MeshComponent(DataClassJsonMixin): def __post_init__(self) -> None: print_dataclass(self) + block_id: BlockId boundaries: list[GeodeId] geode_id: GeodeId internals: list[GeodeId] is_active: bool name: str type: str - viewer_id: ViewerId @dataclass @@ -74,9 +74,9 @@ def __post_init__(self) -> None: "CRS", "AttributeInfo", "AttributeName", + "BlockId", "CollectionComponent", "Filename", "MeshComponent", "Point3D", - "ViewerId", ] diff --git a/src/opengeodeweb_back/utils_functions.py b/src/opengeodeweb_back/utils_functions.py index a63109df..3dcab544 100644 --- a/src/opengeodeweb_back/utils_functions.py +++ b/src/opengeodeweb_back/utils_functions.py @@ -265,13 +265,13 @@ def _mesh_components(model: GeodeModel, uuid_to_flat_index: dict[str, int]) -> l component_name = component.name() if not component_name: component_name = geode_id - viewer_id = uuid_to_flat_index[geode_id] + block_id = uuid_to_flat_index[geode_id] boundaries = model.boundaries(component_id) boundaries_uuid = [boundary.id.string() for boundary in boundaries] internals = model.internals(component_id) internals_uuid = [internal.id.string() for internal in internals] mesh_component_object = { - "viewer_id": viewer_id, + "block_id": block_id, "geode_id": geode_id, "name": component_name, "type": component_type, diff --git a/tests/test_routes.py b/tests/test_routes.py index 056452e3..63effb8f 100644 --- a/tests/test_routes.py +++ b/tests/test_routes.py @@ -569,7 +569,7 @@ def test_model_components(client: FlaskClient) -> None: for mesh_component in mesh_components: assert isinstance(mesh_component, dict) assert isinstance(mesh_component["geode_id"], str) - assert isinstance(mesh_component["viewer_id"], int) + assert isinstance(mesh_component["block_id"], int) assert isinstance(mesh_component["name"], str) assert isinstance(mesh_component["type"], str) assert isinstance(mesh_component["boundaries"], list)