From a6e6e350e7ec75e3aa9d0be1fc16f832fd9ae5c3 Mon Sep 17 00:00:00 2001 From: Kye Gomez Date: Mon, 3 Feb 2025 20:18:20 -0500 Subject: [PATCH] [cleanup] --- api.py => api/api.py | 0 check_api_key.py | 2 -- cloud_schema.sql | 20 ++++++++++---------- test_api.py | 1 - 4 files changed, 10 insertions(+), 13 deletions(-) rename api.py => api/api.py (100%) diff --git a/api.py b/api/api.py similarity index 100% rename from api.py rename to api/api.py diff --git a/check_api_key.py b/check_api_key.py index eb06b20..d15b56e 100644 --- a/check_api_key.py +++ b/check_api_key.py @@ -1,4 +1,3 @@ - import os import supabase @@ -49,4 +48,3 @@ def get_user_id_from_api_key(api_key: str) -> str: if not response.data: raise ValueError("Invalid API key") return response.data[0]["user_id"] - diff --git a/cloud_schema.sql b/cloud_schema.sql index 374edd5..9e13e75 100644 --- a/cloud_schema.sql +++ b/cloud_schema.sql @@ -28,16 +28,16 @@ CREATE POLICY api_keys_insert_policy ON swarms_cloud_api_keys -- Table: swarms_cloud_agents ----------------------------------------------------------- CREATE TABLE swarms_cloud_agents ( - id uuid PRIMARY KEY DEFAULT uuid_generate_v4(), - name text NOT NULL, - description text, - code text NOT NULL, - requirements text, - envs text, - autoscaling boolean DEFAULT false, - created_at timestamptz DEFAULT now(), - updated_at timestamptz DEFAULT now(), - owner uuid NOT NULL -- The owner of the agent (should be auth.uid()) + id uuid PRIMARY KEY DEFAULT uuid_generate_v4(), + name text NOT NULL, + description text, + code text NOT NULL, + requirements text, + envs text, + autoscaling boolean DEFAULT false, + created_at timestamptz DEFAULT now(), + updated_at timestamptz DEFAULT now(), + owner uuid NOT NULL -- The owner of the agent (should be auth.uid()) ); -- Enable Row Level Security on agents. diff --git a/test_api.py b/test_api.py index 4412c95..9d91afa 100644 --- a/test_api.py +++ b/test_api.py @@ -94,7 +94,6 @@ def test_get_agent_history(agent_id): assert "executions" in response.json() - def run_all_tests(): try: # Test basic endpoints