Skip to content

Commit

Permalink
feat: export all models from passageidentity (#133)
Browse files Browse the repository at this point in the history
  • Loading branch information
ctran88 authored Jan 3, 2025
1 parent 7af039c commit 872ba81
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 21 deletions.
31 changes: 30 additions & 1 deletion passageidentity/__init__.py
Original file line number Diff line number Diff line change
@@ -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",
]
7 changes: 6 additions & 1 deletion passageidentity/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
16 changes: 3 additions & 13 deletions passageidentity/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down
4 changes: 1 addition & 3 deletions tests/auth_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 1 addition & 3 deletions tests/user_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 872ba81

Please sign in to comment.