diff --git a/js/sdk/src/v3/clients/users.ts b/js/sdk/src/v3/clients/users.ts index 2d91982cd..87380d3df 100644 --- a/js/sdk/src/v3/clients/users.ts +++ b/js/sdk/src/v3/clients/users.ts @@ -54,23 +54,6 @@ export class UsersClient { }); } - /** - * Register a new user. - * @param email User's email address - * @param password User's password - * @returns WrappedUserResponse - * @deprecated Use `client.users.create` instead. - */ - @feature("users.register") - async register(options: { - email: string; - password: string; - }): Promise { - return this.client.makeRequest("POST", "users/register", { - data: options, - }); - } - /** * Send a verification email to a user. * @param email User's email address diff --git a/llms.txt b/llms.txt index a6b113653..f646dbf6b 100644 --- a/llms.txt +++ b/llms.txt @@ -3133,7 +3133,7 @@ from r2r import R2RClient client = R2RClient("http://localhost:7272") # Replace with your R2R deployment URL # Register a new user -user_result = client.users.register("user1@test.com", "password123") +user_result = client.users.create("user1@test.com", "password123") print(user_result) # {'results': {'email': 'user1@test.com', 'id': 'bf417057-f104-4e75-8579-c74d26fcbed3', ...}} diff --git a/py/sdk/v3/users.py b/py/sdk/v3/users.py index bea1e70a1..f524646a5 100644 --- a/py/sdk/v3/users.py +++ b/py/sdk/v3/users.py @@ -1,5 +1,3 @@ -from __future__ import annotations # for Python 3.10+ - from typing import Any, Optional from uuid import UUID @@ -59,26 +57,6 @@ async def create( version="v3", ) - # @deprecated("Use client.users.create() instead") - async def register(self, email: str, password: str) -> WrappedUserResponse: - """ - Register a new user. - - Args: - email (str): User's email address - password (str): User's password - - Returns: - UserResponse: New user information - """ - data: dict[str, Any] = {"email": email, "password": password} - return await self.client._make_request( - "POST", - "users/register", - json=data, - version="v3", - ) - async def send_verification_email( self, email: str ) -> WrappedGenericMessageResponse: diff --git a/py/tests/integration/test_chunks.py b/py/tests/integration/test_chunks.py index 572dd1491..7b0343927 100644 --- a/py/tests/integration/test_chunks.py +++ b/py/tests/integration/test_chunks.py @@ -52,7 +52,7 @@ async def search_chunks(self, query: str, limit: int = 5) -> list[dict]: return response["results"] async def register_user(self, email: str, password: str) -> None: - await self.client.users.register(email, password) + await self.client.users.create(email, password) async def login_user(self, email: str, password: str) -> None: await self.client.users.login(email, password) diff --git a/py/tests/integration/test_documents.py b/py/tests/integration/test_documents.py index 8e5393668..68595529d 100644 --- a/py/tests/integration/test_documents.py +++ b/py/tests/integration/test_documents.py @@ -199,7 +199,7 @@ def test_search_documents(client, test_document): def test_list_document_chunks(mutable_client, cleanup_documents): temp_user = f"{uuid.uuid4()}@me.com" - mutable_client.users.register(temp_user, "password") + mutable_client.users.create(temp_user, "password") mutable_client.users.login(temp_user, "password") resp = mutable_client.documents.create( @@ -251,7 +251,7 @@ def test_get_document_collections_non_superuser(client): # Create a non-superuser client non_super_client = R2RClient(client.base_url) random_string = str(uuid.uuid4()) - non_super_client.users.register(f"{random_string}@me.com", "password") + non_super_client.users.create(f"{random_string}@me.com", "password") non_super_client.users.login(f"{random_string}@me.com", "password") document_id = str(uuid.uuid4()) # Some doc ID @@ -273,7 +273,7 @@ def test_access_document_not_owned(client, cleanup_documents): # Now try to access with a non-superuser non_super_client = R2RClient(client.base_url) random_string = str(uuid.uuid4()) - non_super_client.users.register(f"{random_string}@me.com", "password") + non_super_client.users.create(f"{random_string}@me.com", "password") non_super_client.users.login(f"{random_string}@me.com", "password") with pytest.raises(R2RException) as exc_info: @@ -285,7 +285,7 @@ def test_access_document_not_owned(client, cleanup_documents): def test_list_documents_with_pagination(mutable_client, cleanup_documents): temp_user = f"{uuid.uuid4()}@me.com" - mutable_client.users.register(temp_user, "password") + mutable_client.users.create(temp_user, "password") mutable_client.users.login(temp_user, "password") for i in range(3): diff --git a/py/tests/integration/test_users.py b/py/tests/integration/test_users.py index 0f7164c0f..e93f828fb 100644 --- a/py/tests/integration/test_users.py +++ b/py/tests/integration/test_users.py @@ -605,7 +605,7 @@ def test_multiple_api_keys(client): def test_update_user_limits_overrides(client: R2RClient): # 1) Create user user_email = f"test_{uuid.uuid4()}@example.com" - client.users.register(user_email, "SomePassword123!") + client.users.create(user_email, "SomePassword123!") client.users.login(user_email, "SomePassword123!") # 2) Confirm the default overrides is None diff --git a/py/tests/scaling/loadTester.py b/py/tests/scaling/loadTester.py index 1e5e9c0ce..215c2201e 100644 --- a/py/tests/scaling/loadTester.py +++ b/py/tests/scaling/loadTester.py @@ -69,7 +69,7 @@ async def register_login_ingest_user(self, user_email: str, password: str): """Register and login a single user with robust error handling.""" # Register user reg_result = await self.safe_call( - self.client.users.register(user_email, password), + self.client.users.create(user_email, password), timeout=REGISTER_TIMEOUT, operation_desc=f"register user {user_email}", ) diff --git a/py/tests/unit/test_chunks.py b/py/tests/unit/test_chunks.py index 823a984bf..5f94d8ee5 100644 --- a/py/tests/unit/test_chunks.py +++ b/py/tests/unit/test_chunks.py @@ -52,7 +52,7 @@ async def search_chunks(self, query: str, limit: int = 5) -> list[dict]: return response["results"] async def register_user(self, email: str, password: str) -> None: - await self.client.users.register(email, password) + await self.client.users.create(email, password) async def login_user(self, email: str, password: str) -> None: await self.client.users.login(email, password)