From 872ba818feb62e5cf7be09052eb0430bf6513b6e Mon Sep 17 00:00:00 2001 From: Chris Tran Date: Fri, 3 Jan 2025 11:12:42 -0600 Subject: [PATCH] feat: export all models from passageidentity (#133) --- passageidentity/__init__.py | 31 +++++++++++++++++++++++++++++- passageidentity/models/__init__.py | 7 ++++++- passageidentity/user.py | 16 +++------------ tests/auth_test.py | 4 +--- tests/user_test.py | 4 +--- 5 files changed, 41 insertions(+), 21 deletions(-) diff --git a/passageidentity/__init__.py b/passageidentity/__init__.py index 817bd2a..9e64734 100644 --- a/passageidentity/__init__.py +++ b/passageidentity/__init__.py @@ -1,12 +1,41 @@ """Initializes the Passage identity package.""" from .errors import PassageError -from .models import MagicLinkArgs, MagicLinkOptions +from .models import ( + MagicLinkArgs, + MagicLinkOptions, + MagicLinkWithEmailArgs, + MagicLinkWithPhoneArgs, + MagicLinkWithUserArgs, +) +from .openapi_client.models import ( + CreateUserArgs, + MagicLink, + MagicLinkChannel, + MagicLinkType, + PassageUser, + UpdateUserArgs, + UserStatus, + WebAuthnDevices, + WebAuthnType, +) from .passage import Passage __all__ = [ + "CreateUserArgs", + "MagicLink", "MagicLinkArgs", + "MagicLinkChannel", "MagicLinkOptions", + "MagicLinkType", + "MagicLinkWithEmailArgs", + "MagicLinkWithPhoneArgs", + "MagicLinkWithUserArgs", "Passage", "PassageError", + "PassageUser", + "UpdateUserArgs", + "UserStatus", + "WebAuthnDevices", + "WebAuthnType", ] diff --git a/passageidentity/models/__init__.py b/passageidentity/models/__init__.py index 2b773cc..a10b24f 100644 --- a/passageidentity/models/__init__.py +++ b/passageidentity/models/__init__.py @@ -19,5 +19,10 @@ ) from passageidentity.models.update_passkey_auth_method import UpdatePasskeysAuthMethod from passageidentity.models.update_otp_auth_method import UpdateOtpAuthMethod -from passageidentity.models.magic_link_args import MagicLinkArgs +from passageidentity.models.magic_link_args import ( + MagicLinkArgs, + MagicLinkWithEmailArgs, + MagicLinkWithPhoneArgs, + MagicLinkWithUserArgs, +) from passageidentity.models.magic_link_options import MagicLinkOptions diff --git a/passageidentity/user.py b/passageidentity/user.py index 078a8d0..d5996c3 100644 --- a/passageidentity/user.py +++ b/passageidentity/user.py @@ -12,25 +12,15 @@ UserDevicesApi, UsersApi, ) -from .openapi_client.models import ( - CreateUserArgs as CreateUserRequest, -) -from .openapi_client.models import ( - PassageUser as UserInfo, -) -from .openapi_client.models import ( - UpdateUserArgs as UpdateUserRequest, -) if TYPE_CHECKING: from .openapi_client.models import ( + CreateUserArgs, + PassageUser, + UpdateUserArgs, WebAuthnDevices, ) -PassageUser = UserInfo -CreateUserArgs = CreateUserRequest -UpdateUserArgs = UpdateUserRequest - class User: """User class for handling operations to get and update user information.""" diff --git a/tests/auth_test.py b/tests/auth_test.py index 788e893..65ac8b3 100644 --- a/tests/auth_test.py +++ b/tests/auth_test.py @@ -5,10 +5,8 @@ from dotenv import load_dotenv from faker import Faker -from passageidentity import PassageError +from passageidentity import MagicLink, Passage, PassageError from passageidentity.openapi_client.models.app_info import AppInfo -from passageidentity.openapi_client.models.magic_link import MagicLink -from passageidentity.passage import Passage load_dotenv() f = Faker() diff --git a/tests/user_test.py b/tests/user_test.py index 4392454..d0a29b4 100644 --- a/tests/user_test.py +++ b/tests/user_test.py @@ -5,9 +5,7 @@ from dotenv import load_dotenv from faker import Faker -from passageidentity.errors import PassageError -from passageidentity.passage import Passage -from passageidentity.user import PassageUser, UpdateUserArgs +from passageidentity import Passage, PassageError, PassageUser, UpdateUserArgs load_dotenv() f = Faker()