From 37087b5acd2073cd54a93c829f1aafac35e6f3d4 Mon Sep 17 00:00:00 2001 From: Daniel McKnight Date: Wed, 6 Nov 2024 14:17:40 -0800 Subject: [PATCH] Mark refactored import paths for deprecation Deprecate `node_v1` schema that is moved to `neon-data-models` --- neon_hana/app/routers/node_server.py | 19 +++++++++++-------- neon_hana/schema/auth_requests.py | 1 + neon_hana/schema/node_model.py | 3 ++- neon_hana/schema/node_v1.py | 27 --------------------------- neon_hana/schema/user_profile.py | 1 + 5 files changed, 15 insertions(+), 36 deletions(-) delete mode 100644 neon_hana/schema/node_v1.py diff --git a/neon_hana/app/routers/node_server.py b/neon_hana/app/routers/node_server.py index c7acd3f..3a2782a 100644 --- a/neon_hana/app/routers/node_server.py +++ b/neon_hana/app/routers/node_server.py @@ -26,7 +26,6 @@ from asyncio import Event from signal import signal, SIGINT -from time import sleep from typing import Optional, Union from fastapi import APIRouter, WebSocket, HTTPException @@ -36,13 +35,17 @@ from neon_hana.app.dependencies import config, client_manager from neon_hana.mq_websocket_api import MQWebsocketAPI, ClientNotKnown -from neon_hana.schema.node_v1 import (NodeAudioInput, NodeGetStt, - NodeGetTts, NodeKlatResponse, - NodeAudioInputResponse, - NodeGetSttResponse, - NodeGetTtsResponse, CoreWWDetected, - CoreIntentFailure, CoreErrorResponse, - CoreClearData, CoreAlertExpired) +from neon_data_models.models.api.node_v1 import (NodeAudioInput, NodeGetStt, + NodeGetTts, NodeKlatResponse, + NodeAudioInputResponse, + NodeGetSttResponse, + NodeGetTtsResponse, + CoreWWDetected, + CoreIntentFailure, + CoreErrorResponse, + CoreClearData, + CoreAlertExpired) + node_route = APIRouter(prefix="/node", tags=["node"]) socket_api = MQWebsocketAPI(config) diff --git a/neon_hana/schema/auth_requests.py b/neon_hana/schema/auth_requests.py index 5032b51..a0acda9 100644 --- a/neon_hana/schema/auth_requests.py +++ b/neon_hana/schema/auth_requests.py @@ -70,6 +70,7 @@ def __getitem__(self, item): return getattr(self, item) raise KeyError(item) + class RefreshRequest(BaseModel): access_token: str refresh_token: str diff --git a/neon_hana/schema/node_model.py b/neon_hana/schema/node_model.py index c7baf73..7345497 100644 --- a/neon_hana/schema/node_model.py +++ b/neon_hana/schema/node_model.py @@ -24,4 +24,5 @@ # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -from neon_data_models.models.client.node import * +from neon_data_models.models.client.node import NodeSoftware, NodeNetworking, NodeLocation, NodeData +# TODO: Mark for deprecation diff --git a/neon_hana/schema/node_v1.py b/neon_hana/schema/node_v1.py deleted file mode 100644 index 6067be0..0000000 --- a/neon_hana/schema/node_v1.py +++ /dev/null @@ -1,27 +0,0 @@ -# NEON AI (TM) SOFTWARE, Software Development Kit & Application Development System -# All trademark and other rights reserved by their respective owners -# Copyright 2008-2024 Neongecko.com Inc. -# BSD-3 -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# 1. Redistributions of source code must retain the above copyright notice, -# this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following disclaimer in the documentation -# and/or other materials provided with the distribution. -# 3. Neither the name of the copyright holder nor the names of its -# contributors may be used to endorse or promote products derived from this -# software without specific prior written permission. -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, -# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -from neon_data_models.models.api.node_v1 import * diff --git a/neon_hana/schema/user_profile.py b/neon_hana/schema/user_profile.py index 47d4e14..85f5f61 100644 --- a/neon_hana/schema/user_profile.py +++ b/neon_hana/schema/user_profile.py @@ -25,3 +25,4 @@ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. from neon_data_models.models.user.neon_profile import * +# TODO: Mark for deprecation