From 88e04ad36cabc6a902c5d9101f18beb9b1ba08b0 Mon Sep 17 00:00:00 2001 From: Avasam Date: Sat, 12 Apr 2025 01:30:19 -0400 Subject: [PATCH 01/12] autogenerate stubs for auth0-python --- scripts/sync_auth0_python.py | 79 +++++++++++ .../@tests/stubtest_allowlist.txt | 24 ++-- stubs/auth0-python/METADATA.toml | 2 + stubs/auth0-python/auth0/__init__.pyi | 7 - .../authentication/back_channel_login.pyi | 8 ++ .../auth0/_asyncified/authentication/base.pyi | 11 ++ .../authentication/client_authentication.pyi | 1 + .../authentication/database.pyi | 16 ++- .../_asyncified/authentication/delegated.pyi | 16 +++ .../_asyncified/authentication/enterprise.pyi | 9 ++ .../_asyncified/authentication/get_token.pyi | 37 +++++ .../authentication/passwordless.pyi | 9 ++ .../pushed_authorization_requests.pyi | 8 ++ .../authentication/revoke_token.pyi | 8 ++ .../_asyncified/authentication/social.pyi | 8 ++ .../authentication/token_verifier.pyi | 29 ++++ .../_asyncified/authentication/users.pyi | 8 ++ .../auth0/_asyncified/management/actions.pyi | 32 +++++ .../management/attack_protection.pyi | 13 ++ .../_asyncified/management/blacklists.pyi | 9 ++ .../auth0/_asyncified/management/branding.pyi | 17 +++ .../management/client_credentials.pyi | 11 ++ .../_asyncified/management/client_grants.pyi | 28 ++++ .../auth0/_asyncified/management/clients.pyi | 20 +++ .../_asyncified/management/connections.pyi | 22 +++ .../_asyncified/management/custom_domains.pyi | 12 ++ .../management/device_credentials.pyi | 20 +++ .../management/email_templates.pyi | 10 ++ .../auth0/_asyncified/management/emails.pyi | 11 ++ .../auth0/_asyncified/management/grants.pyi | 15 ++ .../auth0/_asyncified/management/guardian.pyi | 16 +++ .../auth0/_asyncified/management/hooks.pyi | 24 ++++ .../auth0/_asyncified/management/jobs.pyi | 19 +++ .../_asyncified/management/log_streams.pyi | 12 ++ .../auth0/_asyncified/management/logs.pyi | 20 +++ .../_asyncified/management/organizations.pyi | 62 ++++++++ .../auth0/_asyncified/management/prompts.pyi | 11 ++ .../management/resource_servers.pyi | 12 ++ .../auth0/_asyncified/management/roles.pyi | 27 ++++ .../auth0/_asyncified/management/rules.pyi | 21 +++ .../_asyncified/management/rules_configs.pyi | 10 ++ .../auth0/_asyncified/management/stats.pyi | 9 ++ .../auth0/_asyncified/management/tenants.pyi | 9 ++ .../auth0/_asyncified/management/tickets.pyi | 9 ++ .../_asyncified/management/user_blocks.pyi | 11 ++ .../auth0/_asyncified/management/users.pyi | 51 +++++++ .../_asyncified/management/users_by_email.pyi | 10 ++ stubs/auth0-python/auth0/asyncify.pyi | 8 +- .../auth0/authentication/__init__.pyi | 10 -- .../authentication/async_token_verifier.pyi | 27 ---- .../authentication/back_channel_login.pyi | 4 - .../auth0/authentication/base.pyi | 31 ---- .../authentication/client_authentication.pyi | 13 -- .../auth0/authentication/delegated.pyi | 12 -- .../auth0/authentication/enterprise.pyi | 5 - .../auth0/authentication/get_token.pyi | 21 --- .../auth0/authentication/passwordless.pyi | 5 - .../pushed_authorization_requests.pyi | 4 - .../auth0/authentication/revoke_token.pyi | 4 - .../auth0/authentication/social.pyi | 4 - .../auth0/authentication/token_verifier.pyi | 29 ---- .../auth0/authentication/users.pyi | 11 -- stubs/auth0-python/auth0/exceptions.pyi | 14 -- .../auth0/management/__init__.pyi | 63 -------- .../auth0-python/auth0/management/actions.pyi | 64 --------- .../auth0/management/async_auth0.pyi | 70 ++++++++- .../auth0/management/attack_protection.pyi | 30 ---- stubs/auth0-python/auth0/management/auth0.pyi | 67 --------- .../auth0/management/blacklists.pyi | 21 --- .../auth0/management/branding.pyi | 38 ----- .../auth0/management/client_credentials.pyi | 26 ---- .../auth0/management/client_grants.pyi | 60 -------- .../auth0-python/auth0/management/clients.pyi | 44 ------ .../auth0/management/connections.pyi | 48 ------- .../auth0/management/custom_domains.pyi | 28 ---- .../auth0/management/device_credentials.pyi | 44 ------ .../auth0/management/email_templates.pyi | 24 ---- .../auth0-python/auth0/management/emails.pyi | 26 ---- .../auth0-python/auth0/management/grants.pyi | 34 ----- .../auth0/management/guardian.pyi | 38 ----- stubs/auth0-python/auth0/management/hooks.pyi | 52 ------- stubs/auth0-python/auth0/management/jobs.pyi | 42 ------ .../auth0/management/log_streams.pyi | 29 ---- stubs/auth0-python/auth0/management/logs.pyi | 44 ------ .../auth0/management/organizations.pyi | 134 ------------------ .../auth0-python/auth0/management/prompts.pyi | 28 ---- .../auth0/management/resource_servers.pyi | 28 ---- stubs/auth0-python/auth0/management/roles.pyi | 63 -------- stubs/auth0-python/auth0/management/rules.pyi | 46 ------ .../auth0/management/rules_configs.pyi | 24 ---- stubs/auth0-python/auth0/management/stats.pyi | 24 ---- .../auth0-python/auth0/management/tenants.pyi | 22 --- .../auth0-python/auth0/management/tickets.pyi | 22 --- .../auth0/management/user_blocks.pyi | 26 ---- stubs/auth0-python/auth0/management/users.pyi | 117 --------------- .../auth0/management/users_by_email.pyi | 24 ---- stubs/auth0-python/auth0/rest.pyi | 48 ------- stubs/auth0-python/auth0/rest_async.pyi | 29 ---- stubs/auth0-python/auth0/types.pyi | 5 - stubs/auth0-python/auth0/utils.pyi | 1 - 100 files changed, 875 insertions(+), 1693 deletions(-) create mode 100644 scripts/sync_auth0_python.py delete mode 100644 stubs/auth0-python/auth0/__init__.pyi create mode 100644 stubs/auth0-python/auth0/_asyncified/authentication/back_channel_login.pyi create mode 100644 stubs/auth0-python/auth0/_asyncified/authentication/base.pyi create mode 100644 stubs/auth0-python/auth0/_asyncified/authentication/client_authentication.pyi rename stubs/auth0-python/auth0/{ => _asyncified}/authentication/database.pyi (55%) create mode 100644 stubs/auth0-python/auth0/_asyncified/authentication/delegated.pyi create mode 100644 stubs/auth0-python/auth0/_asyncified/authentication/enterprise.pyi create mode 100644 stubs/auth0-python/auth0/_asyncified/authentication/get_token.pyi create mode 100644 stubs/auth0-python/auth0/_asyncified/authentication/passwordless.pyi create mode 100644 stubs/auth0-python/auth0/_asyncified/authentication/pushed_authorization_requests.pyi create mode 100644 stubs/auth0-python/auth0/_asyncified/authentication/revoke_token.pyi create mode 100644 stubs/auth0-python/auth0/_asyncified/authentication/social.pyi create mode 100644 stubs/auth0-python/auth0/_asyncified/authentication/token_verifier.pyi create mode 100644 stubs/auth0-python/auth0/_asyncified/authentication/users.pyi create mode 100644 stubs/auth0-python/auth0/_asyncified/management/actions.pyi create mode 100644 stubs/auth0-python/auth0/_asyncified/management/attack_protection.pyi create mode 100644 stubs/auth0-python/auth0/_asyncified/management/blacklists.pyi create mode 100644 stubs/auth0-python/auth0/_asyncified/management/branding.pyi create mode 100644 stubs/auth0-python/auth0/_asyncified/management/client_credentials.pyi create mode 100644 stubs/auth0-python/auth0/_asyncified/management/client_grants.pyi create mode 100644 stubs/auth0-python/auth0/_asyncified/management/clients.pyi create mode 100644 stubs/auth0-python/auth0/_asyncified/management/connections.pyi create mode 100644 stubs/auth0-python/auth0/_asyncified/management/custom_domains.pyi create mode 100644 stubs/auth0-python/auth0/_asyncified/management/device_credentials.pyi create mode 100644 stubs/auth0-python/auth0/_asyncified/management/email_templates.pyi create mode 100644 stubs/auth0-python/auth0/_asyncified/management/emails.pyi create mode 100644 stubs/auth0-python/auth0/_asyncified/management/grants.pyi create mode 100644 stubs/auth0-python/auth0/_asyncified/management/guardian.pyi create mode 100644 stubs/auth0-python/auth0/_asyncified/management/hooks.pyi create mode 100644 stubs/auth0-python/auth0/_asyncified/management/jobs.pyi create mode 100644 stubs/auth0-python/auth0/_asyncified/management/log_streams.pyi create mode 100644 stubs/auth0-python/auth0/_asyncified/management/logs.pyi create mode 100644 stubs/auth0-python/auth0/_asyncified/management/organizations.pyi create mode 100644 stubs/auth0-python/auth0/_asyncified/management/prompts.pyi create mode 100644 stubs/auth0-python/auth0/_asyncified/management/resource_servers.pyi create mode 100644 stubs/auth0-python/auth0/_asyncified/management/roles.pyi create mode 100644 stubs/auth0-python/auth0/_asyncified/management/rules.pyi create mode 100644 stubs/auth0-python/auth0/_asyncified/management/rules_configs.pyi create mode 100644 stubs/auth0-python/auth0/_asyncified/management/stats.pyi create mode 100644 stubs/auth0-python/auth0/_asyncified/management/tenants.pyi create mode 100644 stubs/auth0-python/auth0/_asyncified/management/tickets.pyi create mode 100644 stubs/auth0-python/auth0/_asyncified/management/user_blocks.pyi create mode 100644 stubs/auth0-python/auth0/_asyncified/management/users.pyi create mode 100644 stubs/auth0-python/auth0/_asyncified/management/users_by_email.pyi delete mode 100644 stubs/auth0-python/auth0/authentication/__init__.pyi delete mode 100644 stubs/auth0-python/auth0/authentication/async_token_verifier.pyi delete mode 100644 stubs/auth0-python/auth0/authentication/back_channel_login.pyi delete mode 100644 stubs/auth0-python/auth0/authentication/base.pyi delete mode 100644 stubs/auth0-python/auth0/authentication/client_authentication.pyi delete mode 100644 stubs/auth0-python/auth0/authentication/delegated.pyi delete mode 100644 stubs/auth0-python/auth0/authentication/enterprise.pyi delete mode 100644 stubs/auth0-python/auth0/authentication/get_token.pyi delete mode 100644 stubs/auth0-python/auth0/authentication/passwordless.pyi delete mode 100644 stubs/auth0-python/auth0/authentication/pushed_authorization_requests.pyi delete mode 100644 stubs/auth0-python/auth0/authentication/revoke_token.pyi delete mode 100644 stubs/auth0-python/auth0/authentication/social.pyi delete mode 100644 stubs/auth0-python/auth0/authentication/token_verifier.pyi delete mode 100644 stubs/auth0-python/auth0/authentication/users.pyi delete mode 100644 stubs/auth0-python/auth0/exceptions.pyi delete mode 100644 stubs/auth0-python/auth0/management/__init__.pyi delete mode 100644 stubs/auth0-python/auth0/management/actions.pyi delete mode 100644 stubs/auth0-python/auth0/management/attack_protection.pyi delete mode 100644 stubs/auth0-python/auth0/management/auth0.pyi delete mode 100644 stubs/auth0-python/auth0/management/blacklists.pyi delete mode 100644 stubs/auth0-python/auth0/management/branding.pyi delete mode 100644 stubs/auth0-python/auth0/management/client_credentials.pyi delete mode 100644 stubs/auth0-python/auth0/management/client_grants.pyi delete mode 100644 stubs/auth0-python/auth0/management/clients.pyi delete mode 100644 stubs/auth0-python/auth0/management/connections.pyi delete mode 100644 stubs/auth0-python/auth0/management/custom_domains.pyi delete mode 100644 stubs/auth0-python/auth0/management/device_credentials.pyi delete mode 100644 stubs/auth0-python/auth0/management/email_templates.pyi delete mode 100644 stubs/auth0-python/auth0/management/emails.pyi delete mode 100644 stubs/auth0-python/auth0/management/grants.pyi delete mode 100644 stubs/auth0-python/auth0/management/guardian.pyi delete mode 100644 stubs/auth0-python/auth0/management/hooks.pyi delete mode 100644 stubs/auth0-python/auth0/management/jobs.pyi delete mode 100644 stubs/auth0-python/auth0/management/log_streams.pyi delete mode 100644 stubs/auth0-python/auth0/management/logs.pyi delete mode 100644 stubs/auth0-python/auth0/management/organizations.pyi delete mode 100644 stubs/auth0-python/auth0/management/prompts.pyi delete mode 100644 stubs/auth0-python/auth0/management/resource_servers.pyi delete mode 100644 stubs/auth0-python/auth0/management/roles.pyi delete mode 100644 stubs/auth0-python/auth0/management/rules.pyi delete mode 100644 stubs/auth0-python/auth0/management/rules_configs.pyi delete mode 100644 stubs/auth0-python/auth0/management/stats.pyi delete mode 100644 stubs/auth0-python/auth0/management/tenants.pyi delete mode 100644 stubs/auth0-python/auth0/management/tickets.pyi delete mode 100644 stubs/auth0-python/auth0/management/user_blocks.pyi delete mode 100644 stubs/auth0-python/auth0/management/users.pyi delete mode 100644 stubs/auth0-python/auth0/management/users_by_email.pyi delete mode 100644 stubs/auth0-python/auth0/rest.pyi delete mode 100644 stubs/auth0-python/auth0/rest_async.pyi delete mode 100644 stubs/auth0-python/auth0/types.pyi delete mode 100644 stubs/auth0-python/auth0/utils.pyi diff --git a/scripts/sync_auth0_python.py b/scripts/sync_auth0_python.py new file mode 100644 index 000000000000..dd1d8a366fdc --- /dev/null +++ b/scripts/sync_auth0_python.py @@ -0,0 +1,79 @@ +import re +import shutil +import sys +from pathlib import Path +from subprocess import check_call, run + +_ASYNCIFIED_PATH = Path("stubs/auth0-python/auth0/_asyncified") +KEEP_LINES_STARTSWITH = ("from ", "import ", " def ", "class ", "\n") + + +def main() -> None: + # Generate the stubs + check_call(("stubgen", "-p", "auth0.authentication", "-p", "auth0.management", "-o", _ASYNCIFIED_PATH)) + + # Move the generated stubs to the right place + shutil.copytree(_ASYNCIFIED_PATH / "auth0", _ASYNCIFIED_PATH, copy_function=shutil.move, dirs_exist_ok=True) + shutil.rmtree(_ASYNCIFIED_PATH / "auth0") + for path_to_remove in ( + (_ASYNCIFIED_PATH / "authentication" / "__init__.pyi"), + (_ASYNCIFIED_PATH / "management" / "__init__.pyi"), + # These manage async in their own way + *_ASYNCIFIED_PATH.rglob("async_*.pyi"), + ): + path_to_remove.unlink() + + # Cleanup and modify the stubs + for stub_path in _ASYNCIFIED_PATH.rglob("*.pyi"): + with stub_path.open() as stub_file: + lines = stub_file.readlines() + + # Only keep imports, classes and public non-special methods + stub_content = "".join( + [ + line + for line in lines + if "def _" not in line and any(True for check in KEEP_LINES_STARTSWITH if line.startswith(check)) + ] + ) + + # Remove redundant ` as ` imports + stub_content = re.sub(r"(.+?) as \1", "\\1", stub_content) + # Fix relative imports + stub_content = stub_content.replace("from ..", "from ...") + # Rename same-level local imports to use transformed class names ahead of time + stub_content = re.sub(r"(from \.\w+? import )(\w+?)\n", "\\1_\\2Async\n", stub_content) + # Prep extra imports + stub_content = "from typing import type_check_only\n" + stub_content + # Rename classes to their stub-only asyncified variant and subclass them + relative_module = (stub_path.relative_to(_ASYNCIFIED_PATH).with_suffix("").as_posix()).replace("/", ".") + # Transform subclasses. These are a bit weird since they may have asyncified methods hidden by base class. + # We must also update their imports + stub_content = re.sub( + r"class (\w+?)\((\w+?)\):", + """\ +@type_check_only +class _\\1Async(_\\2Async):""", + stub_content, + ) + # Transform base classes + stub_content = re.sub( + r"class (\w+?):", + f"""\ +from auth0.{relative_module} import \\1 # noqa: E402 +@type_check_only +class _\\1Async(\\1):""", + stub_content, + ) + # Update methods to their asyncified variant + stub_content = re.sub(r" def (.+?)\(", " async def \\1_async(", stub_content) + # Fix empty classes + stub_content = stub_content.replace("):\n\n", "): ...\n\n") + + stub_path.write_text("# AUTOGENERATED BY scripts/sync_auth0_python.py\n" + stub_content) + + run((sys.executable, "-m", "pre_commit", "run", "--files", *_ASYNCIFIED_PATH.rglob("*.pyi")), check=False) + + +if __name__ == "__main__": + main() diff --git a/stubs/auth0-python/@tests/stubtest_allowlist.txt b/stubs/auth0-python/@tests/stubtest_allowlist.txt index 8264245ada21..341173a08980 100644 --- a/stubs/auth0-python/@tests/stubtest_allowlist.txt +++ b/stubs/auth0-python/@tests/stubtest_allowlist.txt @@ -1,17 +1,17 @@ # Omit tests auth0\.test.* -# Omit _async functions because they aren't present in the code -auth0\..*_async +# # Omit _async functions because they aren't present in the code +# auth0\..*_async -# Inconsistently implemented, ommitted -auth0.asyncify.AsyncRestClient.file_post -auth0.authentication.async_token_verifier.AsyncRestClient.file_post -auth0.management.Auth0\..* -auth0.rest_async.AsyncRestClient.file_post -auth0.authentication.async_token_verifier.AsyncTokenVerifier.verify +# # Inconsistently implemented, ommitted +# auth0.asyncify.AsyncRestClient.file_post +# auth0.authentication.async_token_verifier.AsyncRestClient.file_post +# auth0.management.Auth0\..* +# auth0.rest_async.AsyncRestClient.file_post +# auth0.authentication.async_token_verifier.AsyncTokenVerifier.verify -# TYPE_CHECKING override makes these show up wrong -auth0.management.async_auth0.RestClientOptions -auth0.management.auth0.RestClientOptions -auth0.rest.RequestsResponse +# # TYPE_CHECKING override makes these show up wrong +# auth0.management.async_auth0.RestClientOptions +# auth0.management.auth0.RestClientOptions +# auth0.rest.RequestsResponse diff --git a/stubs/auth0-python/METADATA.toml b/stubs/auth0-python/METADATA.toml index 86faedcae1e1..18b052c73ac6 100644 --- a/stubs/auth0-python/METADATA.toml +++ b/stubs/auth0-python/METADATA.toml @@ -1,3 +1,5 @@ version = "4.8.*" upstream_repository = "https://github.com/auth0/auth0-python" requires = ["cryptography", "types-requests"] +# Inline typing of the library is complete, but it's missing dynamically generated _async methods and subclasses, which we generate +partial_stub = true diff --git a/stubs/auth0-python/auth0/__init__.pyi b/stubs/auth0-python/auth0/__init__.pyi deleted file mode 100644 index 3dfa028c921c..000000000000 --- a/stubs/auth0-python/auth0/__init__.pyi +++ /dev/null @@ -1,7 +0,0 @@ -from auth0.exceptions import ( - Auth0Error as Auth0Error, - RateLimitError as RateLimitError, - TokenValidationError as TokenValidationError, -) - -__all__ = ("Auth0Error", "RateLimitError", "TokenValidationError") diff --git a/stubs/auth0-python/auth0/_asyncified/authentication/back_channel_login.pyi b/stubs/auth0-python/auth0/_asyncified/authentication/back_channel_login.pyi new file mode 100644 index 000000000000..c08ba605a8f9 --- /dev/null +++ b/stubs/auth0-python/auth0/_asyncified/authentication/back_channel_login.pyi @@ -0,0 +1,8 @@ +# AUTOGENERATED BY scripts/sync_auth0_python.py +from typing import Any, type_check_only + +from .base import _AuthenticationBaseAsync + +@type_check_only +class _BackChannelLoginAsync(_AuthenticationBaseAsync): + async def back_channel_login_async(self, binding_message: str, login_hint: str, scope: str, **kwargs) -> Any: ... diff --git a/stubs/auth0-python/auth0/_asyncified/authentication/base.pyi b/stubs/auth0-python/auth0/_asyncified/authentication/base.pyi new file mode 100644 index 000000000000..ae72534f8c51 --- /dev/null +++ b/stubs/auth0-python/auth0/_asyncified/authentication/base.pyi @@ -0,0 +1,11 @@ +# AUTOGENERATED BY scripts/sync_auth0_python.py +from typing import Any, type_check_only + +from auth0.authentication.base import AuthenticationBase +from auth0.types import RequestData + +@type_check_only +class _AuthenticationBaseAsync(AuthenticationBase): + async def post_async(self, url: str, data: RequestData | None = None, headers: dict[str, str] | None = None) -> Any: ... + async def authenticated_post_async(self, url: str, data: dict[str, Any], headers: dict[str, str] | None = None) -> Any: ... + async def get_async(self, url: str, params: dict[str, Any] | None = None, headers: dict[str, str] | None = None) -> Any: ... diff --git a/stubs/auth0-python/auth0/_asyncified/authentication/client_authentication.pyi b/stubs/auth0-python/auth0/_asyncified/authentication/client_authentication.pyi new file mode 100644 index 000000000000..cc721600d00b --- /dev/null +++ b/stubs/auth0-python/auth0/_asyncified/authentication/client_authentication.pyi @@ -0,0 +1 @@ +# AUTOGENERATED BY scripts/sync_auth0_python.py diff --git a/stubs/auth0-python/auth0/authentication/database.pyi b/stubs/auth0-python/auth0/_asyncified/authentication/database.pyi similarity index 55% rename from stubs/auth0-python/auth0/authentication/database.pyi rename to stubs/auth0-python/auth0/_asyncified/authentication/database.pyi index e08752c27897..b74b774f2f7b 100644 --- a/stubs/auth0-python/auth0/authentication/database.pyi +++ b/stubs/auth0-python/auth0/_asyncified/authentication/database.pyi @@ -1,21 +1,23 @@ -from _typeshed import Incomplete +# AUTOGENERATED BY scripts/sync_auth0_python.py +from typing import Any, type_check_only -from .base import AuthenticationBase as AuthenticationBase +from .base import _AuthenticationBaseAsync -class Database(AuthenticationBase): - def signup( +@type_check_only +class _DatabaseAsync(_AuthenticationBaseAsync): + async def signup_async( self, email: str, password: str, connection: str, username: str | None = None, - user_metadata: dict[str, Incomplete] | None = None, + user_metadata: dict[str, Any] | None = None, given_name: str | None = None, family_name: str | None = None, name: str | None = None, nickname: str | None = None, picture: str | None = None, - ) -> dict[str, Incomplete]: ... - def change_password( + ) -> dict[str, Any]: ... + async def change_password_async( self, email: str, connection: str, password: str | None = None, organization: str | None = None ) -> str: ... diff --git a/stubs/auth0-python/auth0/_asyncified/authentication/delegated.pyi b/stubs/auth0-python/auth0/_asyncified/authentication/delegated.pyi new file mode 100644 index 000000000000..d67e0c463c7b --- /dev/null +++ b/stubs/auth0-python/auth0/_asyncified/authentication/delegated.pyi @@ -0,0 +1,16 @@ +# AUTOGENERATED BY scripts/sync_auth0_python.py +from typing import Any, type_check_only + +from .base import _AuthenticationBaseAsync + +@type_check_only +class _DelegatedAsync(_AuthenticationBaseAsync): + async def get_token_async( + self, + target: str, + api_type: str, + grant_type: str, + id_token: str | None = None, + refresh_token: str | None = None, + scope: str = "openid", + ) -> Any: ... diff --git a/stubs/auth0-python/auth0/_asyncified/authentication/enterprise.pyi b/stubs/auth0-python/auth0/_asyncified/authentication/enterprise.pyi new file mode 100644 index 000000000000..6ed2dd8ee777 --- /dev/null +++ b/stubs/auth0-python/auth0/_asyncified/authentication/enterprise.pyi @@ -0,0 +1,9 @@ +# AUTOGENERATED BY scripts/sync_auth0_python.py +from typing import Any, type_check_only + +from .base import _AuthenticationBaseAsync + +@type_check_only +class _EnterpriseAsync(_AuthenticationBaseAsync): + async def saml_metadata_async(self) -> Any: ... + async def wsfed_metadata_async(self) -> Any: ... diff --git a/stubs/auth0-python/auth0/_asyncified/authentication/get_token.pyi b/stubs/auth0-python/auth0/_asyncified/authentication/get_token.pyi new file mode 100644 index 000000000000..d92c789dcebb --- /dev/null +++ b/stubs/auth0-python/auth0/_asyncified/authentication/get_token.pyi @@ -0,0 +1,37 @@ +# AUTOGENERATED BY scripts/sync_auth0_python.py +from typing import Any, type_check_only + +from .base import _AuthenticationBaseAsync + +@type_check_only +class _GetTokenAsync(_AuthenticationBaseAsync): + async def authorization_code_async( + self, code: str, redirect_uri: str | None, grant_type: str = "authorization_code" + ) -> Any: ... + async def authorization_code_pkce_async( + self, code_verifier: str, code: str, redirect_uri: str | None, grant_type: str = "authorization_code" + ) -> Any: ... + async def client_credentials_async( + self, audience: str, grant_type: str = "client_credentials", organization: str | None = None + ) -> Any: ... + async def login_async( + self, + username: str, + password: str, + scope: str | None = None, + realm: str | None = None, + audience: str | None = None, + grant_type: str = "http://auth0.com/oauth/grant-type/password-realm", + forwarded_for: str | None = None, + ) -> Any: ... + async def refresh_token_async(self, refresh_token: str, scope: str = "", grant_type: str = "refresh_token") -> Any: ... + async def passwordless_login_async(self, username: str, otp: str, realm: str, scope: str, audience: str) -> Any: ... + async def backchannel_login_async(self, auth_req_id: str, grant_type: str = "urn:openid:params:grant-type:ciba") -> Any: ... + async def access_token_for_connection_async( + self, + subject_token_type: str, + subject_token: str, + requested_token_type: str, + connection: str | None = None, + grant_type: str = "urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token", + ) -> Any: ... diff --git a/stubs/auth0-python/auth0/_asyncified/authentication/passwordless.pyi b/stubs/auth0-python/auth0/_asyncified/authentication/passwordless.pyi new file mode 100644 index 000000000000..c0f88efa9078 --- /dev/null +++ b/stubs/auth0-python/auth0/_asyncified/authentication/passwordless.pyi @@ -0,0 +1,9 @@ +# AUTOGENERATED BY scripts/sync_auth0_python.py +from typing import Any, type_check_only + +from .base import _AuthenticationBaseAsync + +@type_check_only +class _PasswordlessAsync(_AuthenticationBaseAsync): + async def email_async(self, email: str, send: str = "link", auth_params: dict[str, str] | None = None) -> Any: ... + async def sms_async(self, phone_number: str) -> Any: ... diff --git a/stubs/auth0-python/auth0/_asyncified/authentication/pushed_authorization_requests.pyi b/stubs/auth0-python/auth0/_asyncified/authentication/pushed_authorization_requests.pyi new file mode 100644 index 000000000000..93e582e87a09 --- /dev/null +++ b/stubs/auth0-python/auth0/_asyncified/authentication/pushed_authorization_requests.pyi @@ -0,0 +1,8 @@ +# AUTOGENERATED BY scripts/sync_auth0_python.py +from typing import Any, type_check_only + +from .base import _AuthenticationBaseAsync + +@type_check_only +class _PushedAuthorizationRequestsAsync(_AuthenticationBaseAsync): + async def pushed_authorization_request_async(self, response_type: str, redirect_uri: str, **kwargs) -> Any: ... diff --git a/stubs/auth0-python/auth0/_asyncified/authentication/revoke_token.pyi b/stubs/auth0-python/auth0/_asyncified/authentication/revoke_token.pyi new file mode 100644 index 000000000000..c1058ec8efc7 --- /dev/null +++ b/stubs/auth0-python/auth0/_asyncified/authentication/revoke_token.pyi @@ -0,0 +1,8 @@ +# AUTOGENERATED BY scripts/sync_auth0_python.py +from typing import Any, type_check_only + +from .base import _AuthenticationBaseAsync + +@type_check_only +class _RevokeTokenAsync(_AuthenticationBaseAsync): + async def revoke_refresh_token_async(self, token: str) -> Any: ... diff --git a/stubs/auth0-python/auth0/_asyncified/authentication/social.pyi b/stubs/auth0-python/auth0/_asyncified/authentication/social.pyi new file mode 100644 index 000000000000..7eb3a180f086 --- /dev/null +++ b/stubs/auth0-python/auth0/_asyncified/authentication/social.pyi @@ -0,0 +1,8 @@ +# AUTOGENERATED BY scripts/sync_auth0_python.py +from typing import Any, type_check_only + +from .base import _AuthenticationBaseAsync + +@type_check_only +class _SocialAsync(_AuthenticationBaseAsync): + async def login_async(self, access_token: str, connection: str, scope: str = "openid") -> Any: ... diff --git a/stubs/auth0-python/auth0/_asyncified/authentication/token_verifier.pyi b/stubs/auth0-python/auth0/_asyncified/authentication/token_verifier.pyi new file mode 100644 index 000000000000..e776ff1c8bb1 --- /dev/null +++ b/stubs/auth0-python/auth0/_asyncified/authentication/token_verifier.pyi @@ -0,0 +1,29 @@ +# AUTOGENERATED BY scripts/sync_auth0_python.py +from typing import Any, type_check_only + +from auth0.authentication.token_verifier import SignatureVerifier +from cryptography.hazmat.primitives.asymmetric.rsa import RSAPublicKey + +@type_check_only +class _SignatureVerifierAsync(SignatureVerifier): + async def verify_signature_async(self, token: str) -> dict[str, Any]: ... + +@type_check_only +class _SymmetricSignatureVerifierAsync(_SignatureVerifierAsync): ... + +from auth0.authentication.token_verifier import JwksFetcher # noqa: E402 + +@type_check_only +class _JwksFetcherAsync(JwksFetcher): + async def get_key_async(self, key_id: str) -> RSAPublicKey: ... + +@type_check_only +class _AsymmetricSignatureVerifierAsync(_SignatureVerifierAsync): ... + +from auth0.authentication.token_verifier import TokenVerifier # noqa: E402 + +@type_check_only +class _TokenVerifierAsync(TokenVerifier): + async def verify_async( + self, token: str, nonce: str | None = None, max_age: int | None = None, organization: str | None = None + ) -> dict[str, Any]: ... diff --git a/stubs/auth0-python/auth0/_asyncified/authentication/users.pyi b/stubs/auth0-python/auth0/_asyncified/authentication/users.pyi new file mode 100644 index 000000000000..fc373e08cd0d --- /dev/null +++ b/stubs/auth0-python/auth0/_asyncified/authentication/users.pyi @@ -0,0 +1,8 @@ +# AUTOGENERATED BY scripts/sync_auth0_python.py +from typing import Any, type_check_only + +from auth0.authentication.users import Users + +@type_check_only +class _UsersAsync(Users): + async def userinfo_async(self, access_token: str) -> dict[str, Any]: ... diff --git a/stubs/auth0-python/auth0/_asyncified/management/actions.pyi b/stubs/auth0-python/auth0/_asyncified/management/actions.pyi new file mode 100644 index 000000000000..99f99cb914dd --- /dev/null +++ b/stubs/auth0-python/auth0/_asyncified/management/actions.pyi @@ -0,0 +1,32 @@ +# AUTOGENERATED BY scripts/sync_auth0_python.py +from typing import Any, type_check_only + +from auth0.management.actions import Actions + +@type_check_only +class _ActionsAsync(Actions): + async def get_actions_async( + self, + trigger_id: str | None = None, + action_name: str | None = None, + deployed: bool | None = None, + installed: bool = False, + page: int | None = None, + per_page: int | None = None, + ) -> Any: ... + async def create_action_async(self, body: dict[str, Any]) -> dict[str, Any]: ... + async def update_action_async(self, id: str, body: dict[str, Any]) -> dict[str, Any]: ... + async def get_action_async(self, id: str) -> dict[str, Any]: ... + async def delete_action_async(self, id: str, force: bool = False) -> Any: ... + async def get_triggers_async(self) -> dict[str, Any]: ... + async def get_execution_async(self, id: str) -> dict[str, Any]: ... + async def get_action_versions_async( + self, id: str, page: int | None = None, per_page: int | None = None + ) -> dict[str, Any]: ... + async def get_trigger_bindings_async( + self, id: str, page: int | None = None, per_page: int | None = None + ) -> dict[str, Any]: ... + async def get_action_version_async(self, action_id: str, version_id: str) -> dict[str, Any]: ... + async def deploy_action_async(self, id: str) -> dict[str, Any]: ... + async def rollback_action_version_async(self, action_id: str, version_id: str) -> dict[str, Any]: ... + async def update_trigger_bindings_async(self, id: str, body: dict[str, Any]) -> dict[str, Any]: ... diff --git a/stubs/auth0-python/auth0/_asyncified/management/attack_protection.pyi b/stubs/auth0-python/auth0/_asyncified/management/attack_protection.pyi new file mode 100644 index 000000000000..7322689c48e0 --- /dev/null +++ b/stubs/auth0-python/auth0/_asyncified/management/attack_protection.pyi @@ -0,0 +1,13 @@ +# AUTOGENERATED BY scripts/sync_auth0_python.py +from typing import Any, type_check_only + +from auth0.management.attack_protection import AttackProtection + +@type_check_only +class _AttackProtectionAsync(AttackProtection): + async def get_breached_password_detection_async(self) -> dict[str, Any]: ... + async def update_breached_password_detection_async(self, body: dict[str, Any]) -> dict[str, Any]: ... + async def get_brute_force_protection_async(self) -> dict[str, Any]: ... + async def update_brute_force_protection_async(self, body: dict[str, Any]) -> dict[str, Any]: ... + async def get_suspicious_ip_throttling_async(self) -> dict[str, Any]: ... + async def update_suspicious_ip_throttling_async(self, body: dict[str, Any]) -> dict[str, Any]: ... diff --git a/stubs/auth0-python/auth0/_asyncified/management/blacklists.pyi b/stubs/auth0-python/auth0/_asyncified/management/blacklists.pyi new file mode 100644 index 000000000000..380df387404a --- /dev/null +++ b/stubs/auth0-python/auth0/_asyncified/management/blacklists.pyi @@ -0,0 +1,9 @@ +# AUTOGENERATED BY scripts/sync_auth0_python.py +from typing import type_check_only + +from auth0.management.blacklists import Blacklists + +@type_check_only +class _BlacklistsAsync(Blacklists): + async def get_async(self, aud: str | None = None) -> list[dict[str, str]]: ... + async def create_async(self, jti: str, aud: str | None = None) -> dict[str, str]: ... diff --git a/stubs/auth0-python/auth0/_asyncified/management/branding.pyi b/stubs/auth0-python/auth0/_asyncified/management/branding.pyi new file mode 100644 index 000000000000..ecd141cd1a17 --- /dev/null +++ b/stubs/auth0-python/auth0/_asyncified/management/branding.pyi @@ -0,0 +1,17 @@ +# AUTOGENERATED BY scripts/sync_auth0_python.py +from typing import Any, type_check_only + +from auth0.management.branding import Branding + +@type_check_only +class _BrandingAsync(Branding): + async def get_async(self) -> dict[str, Any]: ... + async def update_async(self, body: dict[str, Any]) -> dict[str, Any]: ... + async def get_template_universal_login_async(self) -> dict[str, Any]: ... + async def delete_template_universal_login_async(self) -> Any: ... + async def update_template_universal_login_async(self, body: dict[str, Any]) -> dict[str, Any]: ... + async def get_default_branding_theme_async(self) -> dict[str, Any]: ... + async def get_branding_theme_async(self, theme_id: str) -> dict[str, Any]: ... + async def delete_branding_theme_async(self, theme_id: str) -> Any: ... + async def update_branding_theme_async(self, theme_id: str, body: dict[str, Any]) -> dict[str, Any]: ... + async def create_branding_theme_async(self, body: dict[str, Any]) -> dict[str, Any]: ... diff --git a/stubs/auth0-python/auth0/_asyncified/management/client_credentials.pyi b/stubs/auth0-python/auth0/_asyncified/management/client_credentials.pyi new file mode 100644 index 000000000000..16eaa0dfcadf --- /dev/null +++ b/stubs/auth0-python/auth0/_asyncified/management/client_credentials.pyi @@ -0,0 +1,11 @@ +# AUTOGENERATED BY scripts/sync_auth0_python.py +from typing import Any, type_check_only + +from auth0.management.client_credentials import ClientCredentials + +@type_check_only +class _ClientCredentialsAsync(ClientCredentials): + async def all_async(self, client_id: str) -> list[dict[str, Any]]: ... + async def get_async(self, client_id: str, id: str) -> dict[str, Any]: ... + async def create_async(self, client_id: str, body: dict[str, Any]) -> dict[str, Any]: ... + async def delete_async(self, client_id: str, id: str) -> dict[str, Any]: ... diff --git a/stubs/auth0-python/auth0/_asyncified/management/client_grants.pyi b/stubs/auth0-python/auth0/_asyncified/management/client_grants.pyi new file mode 100644 index 000000000000..128ed3329cd9 --- /dev/null +++ b/stubs/auth0-python/auth0/_asyncified/management/client_grants.pyi @@ -0,0 +1,28 @@ +# AUTOGENERATED BY scripts/sync_auth0_python.py +from typing import Any, type_check_only + +from auth0.management.client_grants import ClientGrants + +@type_check_only +class _ClientGrantsAsync(ClientGrants): + async def all_async( + self, + audience: str | None = None, + page: int | None = None, + per_page: int | None = None, + include_totals: bool = False, + client_id: str | None = None, + allow_any_organization: bool | None = None, + ): ... + async def create_async(self, body: dict[str, Any]) -> dict[str, Any]: ... + async def delete_async(self, id: str) -> Any: ... + async def update_async(self, id: str, body: dict[str, Any]) -> dict[str, Any]: ... + async def get_organizations_async( + self, + id: str, + page: int | None = None, + per_page: int | None = None, + include_totals: bool = False, + from_param: str | None = None, + take: int | None = None, + ): ... diff --git a/stubs/auth0-python/auth0/_asyncified/management/clients.pyi b/stubs/auth0-python/auth0/_asyncified/management/clients.pyi new file mode 100644 index 000000000000..26fef233e89b --- /dev/null +++ b/stubs/auth0-python/auth0/_asyncified/management/clients.pyi @@ -0,0 +1,20 @@ +# AUTOGENERATED BY scripts/sync_auth0_python.py +from typing import Any, type_check_only + +from auth0.management.clients import Clients + +@type_check_only +class _ClientsAsync(Clients): + async def all_async( + self, + fields: list[str] | None = None, + include_fields: bool = True, + page: int | None = None, + per_page: int | None = None, + extra_params: dict[str, Any] | None = None, + ) -> list[dict[str, Any]]: ... + async def create_async(self, body: dict[str, Any]) -> dict[str, Any]: ... + async def get_async(self, id: str, fields: list[str] | None = None, include_fields: bool = True) -> dict[str, Any]: ... + async def delete_async(self, id: str) -> Any: ... + async def update_async(self, id: str, body: dict[str, Any]) -> dict[str, Any]: ... + async def rotate_secret_async(self, id: str) -> dict[str, Any]: ... diff --git a/stubs/auth0-python/auth0/_asyncified/management/connections.pyi b/stubs/auth0-python/auth0/_asyncified/management/connections.pyi new file mode 100644 index 000000000000..916288aac18a --- /dev/null +++ b/stubs/auth0-python/auth0/_asyncified/management/connections.pyi @@ -0,0 +1,22 @@ +# AUTOGENERATED BY scripts/sync_auth0_python.py +from typing import Any, type_check_only + +from auth0.management.connections import Connections + +@type_check_only +class _ConnectionsAsync(Connections): + async def all_async( + self, + strategy: str | None = None, + fields: list[str] | None = None, + include_fields: bool = True, + page: int | None = None, + per_page: int | None = None, + extra_params: dict[str, Any] | None = None, + name: str | None = None, + ) -> list[dict[str, Any]]: ... + async def get_async(self, id: str, fields: list[str] | None = None, include_fields: bool = True) -> dict[str, Any]: ... + async def delete_async(self, id: str) -> Any: ... + async def update_async(self, id: str, body: dict[str, Any]) -> dict[str, Any]: ... + async def create_async(self, body: dict[str, Any]) -> dict[str, Any]: ... + async def delete_user_by_email_async(self, id: str, email: str) -> Any: ... diff --git a/stubs/auth0-python/auth0/_asyncified/management/custom_domains.pyi b/stubs/auth0-python/auth0/_asyncified/management/custom_domains.pyi new file mode 100644 index 000000000000..7b952606598e --- /dev/null +++ b/stubs/auth0-python/auth0/_asyncified/management/custom_domains.pyi @@ -0,0 +1,12 @@ +# AUTOGENERATED BY scripts/sync_auth0_python.py +from typing import Any, type_check_only + +from auth0.management.custom_domains import CustomDomains + +@type_check_only +class _CustomDomainsAsync(CustomDomains): + async def all_async(self) -> list[dict[str, Any]]: ... + async def get_async(self, id: str) -> dict[str, Any]: ... + async def delete_async(self, id: str) -> Any: ... + async def create_new_async(self, body: dict[str, Any]) -> dict[str, Any]: ... + async def verify_async(self, id: str) -> dict[str, Any]: ... diff --git a/stubs/auth0-python/auth0/_asyncified/management/device_credentials.pyi b/stubs/auth0-python/auth0/_asyncified/management/device_credentials.pyi new file mode 100644 index 000000000000..7cd767b8cd91 --- /dev/null +++ b/stubs/auth0-python/auth0/_asyncified/management/device_credentials.pyi @@ -0,0 +1,20 @@ +# AUTOGENERATED BY scripts/sync_auth0_python.py +from typing import Any, type_check_only + +from auth0.management.device_credentials import DeviceCredentials + +@type_check_only +class _DeviceCredentialsAsync(DeviceCredentials): + async def get_async( + self, + user_id: str, + client_id: str, + type: str, + fields: list[str] | None = None, + include_fields: bool = True, + page: int | None = None, + per_page: int | None = None, + include_totals: bool = False, + ): ... + async def create_async(self, body: dict[str, Any]) -> dict[str, Any]: ... + async def delete_async(self, id: str) -> Any: ... diff --git a/stubs/auth0-python/auth0/_asyncified/management/email_templates.pyi b/stubs/auth0-python/auth0/_asyncified/management/email_templates.pyi new file mode 100644 index 000000000000..2d48fda3422c --- /dev/null +++ b/stubs/auth0-python/auth0/_asyncified/management/email_templates.pyi @@ -0,0 +1,10 @@ +# AUTOGENERATED BY scripts/sync_auth0_python.py +from typing import Any, type_check_only + +from auth0.management.email_templates import EmailTemplates + +@type_check_only +class _EmailTemplatesAsync(EmailTemplates): + async def create_async(self, body: dict[str, Any]) -> dict[str, Any]: ... + async def get_async(self, template_name: str) -> dict[str, Any]: ... + async def update_async(self, template_name: str, body: dict[str, Any]) -> dict[str, Any]: ... diff --git a/stubs/auth0-python/auth0/_asyncified/management/emails.pyi b/stubs/auth0-python/auth0/_asyncified/management/emails.pyi new file mode 100644 index 000000000000..9a1f258eb564 --- /dev/null +++ b/stubs/auth0-python/auth0/_asyncified/management/emails.pyi @@ -0,0 +1,11 @@ +# AUTOGENERATED BY scripts/sync_auth0_python.py +from typing import Any, type_check_only + +from auth0.management.emails import Emails + +@type_check_only +class _EmailsAsync(Emails): + async def get_async(self, fields: list[str] | None = None, include_fields: bool = True) -> dict[str, Any]: ... + async def config_async(self, body: dict[str, Any]) -> dict[str, Any]: ... + async def delete_async(self) -> Any: ... + async def update_async(self, body: dict[str, Any]) -> dict[str, Any]: ... diff --git a/stubs/auth0-python/auth0/_asyncified/management/grants.pyi b/stubs/auth0-python/auth0/_asyncified/management/grants.pyi new file mode 100644 index 000000000000..61c692fb3087 --- /dev/null +++ b/stubs/auth0-python/auth0/_asyncified/management/grants.pyi @@ -0,0 +1,15 @@ +# AUTOGENERATED BY scripts/sync_auth0_python.py +from typing import Any, type_check_only + +from auth0.management.grants import Grants + +@type_check_only +class _GrantsAsync(Grants): + async def all_async( + self, + page: int | None = None, + per_page: int | None = None, + include_totals: bool = False, + extra_params: dict[str, Any] | None = None, + ): ... + async def delete_async(self, id: str) -> Any: ... diff --git a/stubs/auth0-python/auth0/_asyncified/management/guardian.pyi b/stubs/auth0-python/auth0/_asyncified/management/guardian.pyi new file mode 100644 index 000000000000..2f99afd96ead --- /dev/null +++ b/stubs/auth0-python/auth0/_asyncified/management/guardian.pyi @@ -0,0 +1,16 @@ +# AUTOGENERATED BY scripts/sync_auth0_python.py +from typing import Any, type_check_only + +from auth0.management.guardian import Guardian + +@type_check_only +class _GuardianAsync(Guardian): + async def all_factors_async(self) -> list[dict[str, Any]]: ... + async def update_factor_async(self, name: str, body: dict[str, Any]) -> dict[str, Any]: ... + async def update_templates_async(self, body: dict[str, Any]) -> dict[str, Any]: ... + async def get_templates_async(self) -> dict[str, Any]: ... + async def get_enrollment_async(self, id: str) -> dict[str, Any]: ... + async def delete_enrollment_async(self, id: str) -> Any: ... + async def create_enrollment_ticket_async(self, body: dict[str, Any]) -> dict[str, Any]: ... + async def get_factor_providers_async(self, factor_name: str, name: str) -> dict[str, Any]: ... + async def update_factor_providers_async(self, factor_name: str, name: str, body: dict[str, Any]) -> dict[str, Any]: ... diff --git a/stubs/auth0-python/auth0/_asyncified/management/hooks.pyi b/stubs/auth0-python/auth0/_asyncified/management/hooks.pyi new file mode 100644 index 000000000000..5ce9b2cf872e --- /dev/null +++ b/stubs/auth0-python/auth0/_asyncified/management/hooks.pyi @@ -0,0 +1,24 @@ +# AUTOGENERATED BY scripts/sync_auth0_python.py +from typing import Any, type_check_only + +from auth0.management.hooks import Hooks + +@type_check_only +class _HooksAsync(Hooks): + async def all_async( + self, + enabled: bool = True, + fields: list[str] | None = None, + include_fields: bool = True, + page: int | None = None, + per_page: int | None = None, + include_totals: bool = False, + ): ... + async def create_async(self, body: dict[str, Any]) -> dict[str, Any]: ... + async def get_async(self, id: str, fields: list[str] | None = None) -> dict[str, Any]: ... + async def delete_async(self, id: str) -> Any: ... + async def update_async(self, id: str, body: dict[str, Any]) -> dict[str, Any]: ... + async def get_secrets_async(self, id: str) -> dict[str, Any]: ... + async def add_secrets_async(self, id: str, body: dict[str, Any]) -> dict[str, Any]: ... + async def delete_secrets_async(self, id: str, body: list[str]) -> Any: ... + async def update_secrets_async(self, id: str, body: dict[str, Any]) -> dict[str, Any]: ... diff --git a/stubs/auth0-python/auth0/_asyncified/management/jobs.pyi b/stubs/auth0-python/auth0/_asyncified/management/jobs.pyi new file mode 100644 index 000000000000..00d948c2b6ce --- /dev/null +++ b/stubs/auth0-python/auth0/_asyncified/management/jobs.pyi @@ -0,0 +1,19 @@ +# AUTOGENERATED BY scripts/sync_auth0_python.py +from typing import Any, type_check_only + +from auth0.management.jobs import Jobs + +@type_check_only +class _JobsAsync(Jobs): + async def get_async(self, id: str) -> dict[str, Any]: ... + async def get_failed_job_async(self, id: str) -> dict[str, Any]: ... + async def export_users_async(self, body: dict[str, Any]): ... + async def import_users_async( + self, + connection_id: str, + file_obj: Any, + upsert: bool = False, + send_completion_email: bool = True, + external_id: str | None = None, + ) -> dict[str, Any]: ... + async def send_verification_email_async(self, body: dict[str, Any]) -> dict[str, Any]: ... diff --git a/stubs/auth0-python/auth0/_asyncified/management/log_streams.pyi b/stubs/auth0-python/auth0/_asyncified/management/log_streams.pyi new file mode 100644 index 000000000000..5d19ca4ae174 --- /dev/null +++ b/stubs/auth0-python/auth0/_asyncified/management/log_streams.pyi @@ -0,0 +1,12 @@ +# AUTOGENERATED BY scripts/sync_auth0_python.py +from typing import Any, type_check_only + +from auth0.management.log_streams import LogStreams + +@type_check_only +class _LogStreamsAsync(LogStreams): + async def list_async(self) -> list[dict[str, Any]]: ... + async def get_async(self, id: str) -> dict[str, Any]: ... + async def create_async(self, body: dict[str, Any]) -> dict[str, Any]: ... + async def delete_async(self, id: str) -> dict[str, Any]: ... + async def update_async(self, id: str, body: dict[str, Any]) -> dict[str, Any]: ... diff --git a/stubs/auth0-python/auth0/_asyncified/management/logs.pyi b/stubs/auth0-python/auth0/_asyncified/management/logs.pyi new file mode 100644 index 000000000000..cad2f495e911 --- /dev/null +++ b/stubs/auth0-python/auth0/_asyncified/management/logs.pyi @@ -0,0 +1,20 @@ +# AUTOGENERATED BY scripts/sync_auth0_python.py +from typing import Any, type_check_only + +from auth0.management.logs import Logs + +@type_check_only +class _LogsAsync(Logs): + async def search_async( + self, + page: int = 0, + per_page: int = 50, + sort: str | None = None, + q: str | None = None, + include_totals: bool = True, + fields: list[str] | None = None, + from_param: str | None = None, + take: int | None = None, + include_fields: bool = True, + ): ... + async def get_async(self, id: str) -> dict[str, Any]: ... diff --git a/stubs/auth0-python/auth0/_asyncified/management/organizations.pyi b/stubs/auth0-python/auth0/_asyncified/management/organizations.pyi new file mode 100644 index 000000000000..174b726d78e5 --- /dev/null +++ b/stubs/auth0-python/auth0/_asyncified/management/organizations.pyi @@ -0,0 +1,62 @@ +# AUTOGENERATED BY scripts/sync_auth0_python.py +from typing import Any, type_check_only + +from auth0.management.organizations import Organizations + +@type_check_only +class _OrganizationsAsync(Organizations): + async def all_organizations_async( + self, + page: int | None = None, + per_page: int | None = None, + include_totals: bool = True, + from_param: str | None = None, + take: int | None = None, + ): ... + async def get_organization_by_name_async(self, name: str | None = None) -> dict[str, Any]: ... + async def get_organization_async(self, id: str) -> dict[str, Any]: ... + async def create_organization_async(self, body: dict[str, Any]) -> dict[str, Any]: ... + async def update_organization_async(self, id: str, body: dict[str, Any]) -> dict[str, Any]: ... + async def delete_organization_async(self, id: str) -> Any: ... + async def all_organization_connections_async( + self, id: str, page: int | None = None, per_page: int | None = None + ) -> list[dict[str, Any]]: ... + async def get_organization_connection_async(self, id: str, connection_id: str) -> dict[str, Any]: ... + async def create_organization_connection_async(self, id: str, body: dict[str, Any]) -> dict[str, Any]: ... + async def update_organization_connection_async(self, id: str, connection_id: str, body: dict[str, Any]) -> dict[str, Any]: ... + async def delete_organization_connection_async(self, id: str, connection_id: str) -> Any: ... + async def all_organization_members_async( + self, + id: str, + page: int | None = None, + per_page: int | None = None, + include_totals: bool = True, + from_param: str | None = None, + take: int | None = None, + fields: list[str] | None = None, + include_fields: bool = True, + ): ... + async def create_organization_members_async(self, id: str, body: dict[str, Any]) -> dict[str, Any]: ... + async def delete_organization_members_async(self, id: str, body: dict[str, Any]) -> Any: ... + async def all_organization_member_roles_async( + self, id: str, user_id: str, page: int | None = None, per_page: int | None = None, include_totals: bool = False + ) -> list[dict[str, Any]]: ... + async def create_organization_member_roles_async(self, id: str, user_id: str, body: dict[str, Any]) -> dict[str, Any]: ... + async def delete_organization_member_roles_async(self, id: str, user_id: str, body: dict[str, Any]) -> Any: ... + async def all_organization_invitations_async( + self, id: str, page: int | None = None, per_page: int | None = None, include_totals: bool = False + ): ... + async def get_organization_invitation_async(self, id: str, invitaton_id: str) -> dict[str, Any]: ... + async def create_organization_invitation_async(self, id: str, body: dict[str, Any]) -> dict[str, Any]: ... + async def delete_organization_invitation_async(self, id: str, invitation_id: str) -> Any: ... + async def get_client_grants_async( + self, + id: str, + audience: str | None = None, + client_id: str | None = None, + page: int | None = None, + per_page: int | None = None, + include_totals: bool = False, + ): ... + async def add_client_grant_async(self, id: str, grant_id: str) -> dict[str, Any]: ... + async def delete_client_grant_async(self, id: str, grant_id: str) -> dict[str, Any]: ... diff --git a/stubs/auth0-python/auth0/_asyncified/management/prompts.pyi b/stubs/auth0-python/auth0/_asyncified/management/prompts.pyi new file mode 100644 index 000000000000..5e9b348159ec --- /dev/null +++ b/stubs/auth0-python/auth0/_asyncified/management/prompts.pyi @@ -0,0 +1,11 @@ +# AUTOGENERATED BY scripts/sync_auth0_python.py +from typing import Any, type_check_only + +from auth0.management.prompts import Prompts + +@type_check_only +class _PromptsAsync(Prompts): + async def get_async(self) -> dict[str, Any]: ... + async def update_async(self, body: dict[str, Any]) -> dict[str, Any]: ... + async def get_custom_text_async(self, prompt: str, language: str): ... + async def update_custom_text_async(self, prompt: str, language: str, body: dict[str, Any]) -> dict[str, Any]: ... diff --git a/stubs/auth0-python/auth0/_asyncified/management/resource_servers.pyi b/stubs/auth0-python/auth0/_asyncified/management/resource_servers.pyi new file mode 100644 index 000000000000..21e011042bcd --- /dev/null +++ b/stubs/auth0-python/auth0/_asyncified/management/resource_servers.pyi @@ -0,0 +1,12 @@ +# AUTOGENERATED BY scripts/sync_auth0_python.py +from typing import Any, type_check_only + +from auth0.management.resource_servers import ResourceServers + +@type_check_only +class _ResourceServersAsync(ResourceServers): + async def create_async(self, body: dict[str, Any]) -> dict[str, Any]: ... + async def get_all_async(self, page: int | None = None, per_page: int | None = None, include_totals: bool = False): ... + async def get_async(self, id: str) -> dict[str, Any]: ... + async def delete_async(self, id: str) -> Any: ... + async def update_async(self, id: str, body: dict[str, Any]) -> dict[str, Any]: ... diff --git a/stubs/auth0-python/auth0/_asyncified/management/roles.pyi b/stubs/auth0-python/auth0/_asyncified/management/roles.pyi new file mode 100644 index 000000000000..9dfed2c28e2d --- /dev/null +++ b/stubs/auth0-python/auth0/_asyncified/management/roles.pyi @@ -0,0 +1,27 @@ +# AUTOGENERATED BY scripts/sync_auth0_python.py +from typing import Any, type_check_only + +from auth0.management.roles import Roles + +@type_check_only +class _RolesAsync(Roles): + async def list_async( + self, page: int = 0, per_page: int = 25, include_totals: bool = True, name_filter: str | None = None + ): ... + async def create_async(self, body: dict[str, Any]) -> dict[str, Any]: ... + async def get_async(self, id: str) -> dict[str, Any]: ... + async def delete_async(self, id: str) -> Any: ... + async def update_async(self, id: str, body: dict[str, Any]) -> dict[str, Any]: ... + async def list_users_async( + self, + id: str, + page: int = 0, + per_page: int = 25, + include_totals: bool = True, + from_param: str | None = None, + take: int | None = None, + ): ... + async def add_users_async(self, id: str, users: list[str]) -> dict[str, Any]: ... + async def list_permissions_async(self, id: str, page: int = 0, per_page: int = 25, include_totals: bool = True): ... + async def remove_permissions_async(self, id: str, permissions: list[dict[str, str]]) -> Any: ... + async def add_permissions_async(self, id: str, permissions: list[dict[str, str]]) -> dict[str, Any]: ... diff --git a/stubs/auth0-python/auth0/_asyncified/management/rules.pyi b/stubs/auth0-python/auth0/_asyncified/management/rules.pyi new file mode 100644 index 000000000000..a0d1b9e7a20f --- /dev/null +++ b/stubs/auth0-python/auth0/_asyncified/management/rules.pyi @@ -0,0 +1,21 @@ +# AUTOGENERATED BY scripts/sync_auth0_python.py +from typing import Any, type_check_only + +from auth0.management.rules import Rules + +@type_check_only +class _RulesAsync(Rules): + async def all_async( + self, + stage: str = "login_success", + enabled: bool = True, + fields: list[str] | None = None, + include_fields: bool = True, + page: int | None = None, + per_page: int | None = None, + include_totals: bool = False, + ): ... + async def create_async(self, body: dict[str, Any]) -> dict[str, Any]: ... + async def get_async(self, id: str, fields: list[str] | None = None, include_fields: bool = True) -> dict[str, Any]: ... + async def delete_async(self, id: str) -> Any: ... + async def update_async(self, id: str, body: dict[str, Any]) -> dict[str, Any]: ... diff --git a/stubs/auth0-python/auth0/_asyncified/management/rules_configs.pyi b/stubs/auth0-python/auth0/_asyncified/management/rules_configs.pyi new file mode 100644 index 000000000000..6f5b6122ba3e --- /dev/null +++ b/stubs/auth0-python/auth0/_asyncified/management/rules_configs.pyi @@ -0,0 +1,10 @@ +# AUTOGENERATED BY scripts/sync_auth0_python.py +from typing import Any, type_check_only + +from auth0.management.rules_configs import RulesConfigs + +@type_check_only +class _RulesConfigsAsync(RulesConfigs): + async def all_async(self) -> list[dict[str, Any]]: ... + async def unset_async(self, key: str) -> Any: ... + async def set_async(self, key: str, value: str) -> dict[str, Any]: ... diff --git a/stubs/auth0-python/auth0/_asyncified/management/stats.pyi b/stubs/auth0-python/auth0/_asyncified/management/stats.pyi new file mode 100644 index 000000000000..f66a687d5d9a --- /dev/null +++ b/stubs/auth0-python/auth0/_asyncified/management/stats.pyi @@ -0,0 +1,9 @@ +# AUTOGENERATED BY scripts/sync_auth0_python.py +from typing import Any, type_check_only + +from auth0.management.stats import Stats + +@type_check_only +class _StatsAsync(Stats): + async def active_users_async(self) -> int: ... + async def daily_stats_async(self, from_date: str | None = None, to_date: str | None = None) -> list[dict[str, Any]]: ... diff --git a/stubs/auth0-python/auth0/_asyncified/management/tenants.pyi b/stubs/auth0-python/auth0/_asyncified/management/tenants.pyi new file mode 100644 index 000000000000..d39cc24cdf3f --- /dev/null +++ b/stubs/auth0-python/auth0/_asyncified/management/tenants.pyi @@ -0,0 +1,9 @@ +# AUTOGENERATED BY scripts/sync_auth0_python.py +from typing import Any, type_check_only + +from auth0.management.tenants import Tenants + +@type_check_only +class _TenantsAsync(Tenants): + async def get_async(self, fields: list[str] | None = None, include_fields: bool = True) -> dict[str, Any]: ... + async def update_async(self, body: dict[str, Any]) -> dict[str, Any]: ... diff --git a/stubs/auth0-python/auth0/_asyncified/management/tickets.pyi b/stubs/auth0-python/auth0/_asyncified/management/tickets.pyi new file mode 100644 index 000000000000..da2556a5725f --- /dev/null +++ b/stubs/auth0-python/auth0/_asyncified/management/tickets.pyi @@ -0,0 +1,9 @@ +# AUTOGENERATED BY scripts/sync_auth0_python.py +from typing import Any, type_check_only + +from auth0.management.tickets import Tickets + +@type_check_only +class _TicketsAsync(Tickets): + async def create_email_verification_async(self, body: dict[str, Any]) -> dict[str, Any]: ... + async def create_pswd_change_async(self, body: dict[str, Any]) -> dict[str, Any]: ... diff --git a/stubs/auth0-python/auth0/_asyncified/management/user_blocks.pyi b/stubs/auth0-python/auth0/_asyncified/management/user_blocks.pyi new file mode 100644 index 000000000000..974526bbf431 --- /dev/null +++ b/stubs/auth0-python/auth0/_asyncified/management/user_blocks.pyi @@ -0,0 +1,11 @@ +# AUTOGENERATED BY scripts/sync_auth0_python.py +from typing import Any, type_check_only + +from auth0.management.user_blocks import UserBlocks + +@type_check_only +class _UserBlocksAsync(UserBlocks): + async def get_by_identifier_async(self, identifier: str) -> dict[str, Any]: ... + async def unblock_by_identifier_async(self, identifier: dict[str, Any]) -> Any: ... + async def get_async(self, id: str) -> dict[str, Any]: ... + async def unblock_async(self, id: str) -> Any: ... diff --git a/stubs/auth0-python/auth0/_asyncified/management/users.pyi b/stubs/auth0-python/auth0/_asyncified/management/users.pyi new file mode 100644 index 000000000000..4c2fc85b2a2f --- /dev/null +++ b/stubs/auth0-python/auth0/_asyncified/management/users.pyi @@ -0,0 +1,51 @@ +# AUTOGENERATED BY scripts/sync_auth0_python.py +from typing import Any, type_check_only + +from auth0.management.users import Users + +@type_check_only +class _UsersAsync(Users): + async def list_async( + self, + page: int = 0, + per_page: int = 25, + sort: str | None = None, + connection: str | None = None, + q: str | None = None, + search_engine: str | None = None, + include_totals: bool = True, + fields: list[str] | None = None, + include_fields: bool = True, + ): ... + async def create_async(self, body: dict[str, Any]) -> dict[str, Any]: ... + async def get_async(self, id: str, fields: list[str] | None = None, include_fields: bool = True) -> dict[str, Any]: ... + async def delete_async(self, id: str) -> Any: ... + async def update_async(self, id: str, body: dict[str, Any]) -> dict[str, Any]: ... + async def list_organizations_async(self, id: str, page: int = 0, per_page: int = 25, include_totals: bool = True): ... + async def list_roles_async(self, id: str, page: int = 0, per_page: int = 25, include_totals: bool = True): ... + async def remove_roles_async(self, id: str, roles: list[str]) -> Any: ... + async def add_roles_async(self, id: str, roles: list[str]) -> dict[str, Any]: ... + async def list_permissions_async(self, id: str, page: int = 0, per_page: int = 25, include_totals: bool = True): ... + async def remove_permissions_async(self, id: str, permissions: list[str]) -> Any: ... + async def add_permissions_async(self, id: str, permissions: list[str]) -> dict[str, Any]: ... + async def delete_multifactor_async(self, id: str, provider: str) -> Any: ... + async def delete_authenticators_async(self, id: str) -> Any: ... + async def unlink_user_account_async(self, id: str, provider: str, user_id: str) -> Any: ... + async def link_user_account_async(self, user_id: str, body: dict[str, Any]) -> list[dict[str, Any]]: ... + async def regenerate_recovery_code_async(self, user_id: str) -> dict[str, Any]: ... + async def get_guardian_enrollments_async(self, user_id: str) -> dict[str, Any]: ... + async def get_log_events_async( + self, user_id: str, page: int = 0, per_page: int = 50, sort: str | None = None, include_totals: bool = False + ): ... + async def invalidate_remembered_browsers_async(self, user_id: str) -> dict[str, Any]: ... + async def get_authentication_methods_async(self, user_id: str) -> dict[str, Any]: ... + async def get_authentication_method_by_id_async(self, user_id: str, authentication_method_id: str) -> dict[str, Any]: ... + async def create_authentication_method_async(self, user_id: str, body: dict[str, Any]) -> dict[str, Any]: ... + async def update_authentication_methods_async(self, user_id: str, body: dict[str, Any]) -> dict[str, Any]: ... + async def update_authentication_method_by_id_async( + self, user_id: str, authentication_method_id: str, body: dict[str, Any] + ) -> dict[str, Any]: ... + async def delete_authentication_methods_async(self, user_id: str) -> Any: ... + async def delete_authentication_method_by_id_async(self, user_id: str, authentication_method_id: str) -> Any: ... + async def list_tokensets_async(self, id: str, page: int = 0, per_page: int = 25, include_totals: bool = True): ... + async def delete_tokenset_by_id_async(self, user_id: str, tokenset_id: str) -> Any: ... diff --git a/stubs/auth0-python/auth0/_asyncified/management/users_by_email.pyi b/stubs/auth0-python/auth0/_asyncified/management/users_by_email.pyi new file mode 100644 index 000000000000..bfb0a9576daa --- /dev/null +++ b/stubs/auth0-python/auth0/_asyncified/management/users_by_email.pyi @@ -0,0 +1,10 @@ +# AUTOGENERATED BY scripts/sync_auth0_python.py +from typing import Any, type_check_only + +from auth0.management.users_by_email import UsersByEmail + +@type_check_only +class _UsersByEmailAsync(UsersByEmail): + async def search_users_by_email_async( + self, email: str, fields: list[str] | None = None, include_fields: bool = True + ) -> list[dict[str, Any]]: ... diff --git a/stubs/auth0-python/auth0/asyncify.pyi b/stubs/auth0-python/auth0/asyncify.pyi index 37c0503bc273..7d75cfe631d5 100644 --- a/stubs/auth0-python/auth0/asyncify.pyi +++ b/stubs/auth0-python/auth0/asyncify.pyi @@ -1,6 +1,2 @@ -from auth0.authentication import Users as Users -from auth0.authentication.base import AuthenticationBase as AuthenticationBase -from auth0.rest import RestClientOptions as RestClientOptions -from auth0.rest_async import AsyncRestClient as AsyncRestClient - -def asyncify(cls): ... +# TODO: Generate mega overload here +def asyncify(cls: type) -> type: ... diff --git a/stubs/auth0-python/auth0/authentication/__init__.pyi b/stubs/auth0-python/auth0/authentication/__init__.pyi deleted file mode 100644 index d6263712af40..000000000000 --- a/stubs/auth0-python/auth0/authentication/__init__.pyi +++ /dev/null @@ -1,10 +0,0 @@ -from .database import Database as Database -from .delegated import Delegated as Delegated -from .enterprise import Enterprise as Enterprise -from .get_token import GetToken as GetToken -from .passwordless import Passwordless as Passwordless -from .revoke_token import RevokeToken as RevokeToken -from .social import Social as Social -from .users import Users as Users - -__all__ = ("Database", "Delegated", "Enterprise", "GetToken", "Passwordless", "RevokeToken", "Social", "Users") diff --git a/stubs/auth0-python/auth0/authentication/async_token_verifier.pyi b/stubs/auth0-python/auth0/authentication/async_token_verifier.pyi deleted file mode 100644 index a65856b039d0..000000000000 --- a/stubs/auth0-python/auth0/authentication/async_token_verifier.pyi +++ /dev/null @@ -1,27 +0,0 @@ -from _typeshed import Incomplete - -from .. import TokenValidationError as TokenValidationError -from ..rest_async import AsyncRestClient as AsyncRestClient -from .token_verifier import ( - AsymmetricSignatureVerifier as AsymmetricSignatureVerifier, - JwksFetcher as JwksFetcher, - TokenVerifier as TokenVerifier, -) - -class AsyncAsymmetricSignatureVerifier(AsymmetricSignatureVerifier): - def __init__(self, jwks_url: str, algorithm: str = "RS256") -> None: ... - def set_session(self, session) -> None: ... - -class AsyncJwksFetcher(JwksFetcher): - def __init__(self, *args, **kwargs) -> None: ... - def set_session(self, session) -> None: ... - async def get_key(self, key_id: str): ... - -class AsyncTokenVerifier(TokenVerifier): - iss: Incomplete - aud: Incomplete - leeway: Incomplete - def __init__( - self, signature_verifier: AsyncAsymmetricSignatureVerifier, issuer: str, audience: str, leeway: int = 0 - ) -> None: ... - def set_session(self, session) -> None: ... diff --git a/stubs/auth0-python/auth0/authentication/back_channel_login.pyi b/stubs/auth0-python/auth0/authentication/back_channel_login.pyi deleted file mode 100644 index 7e45855fa264..000000000000 --- a/stubs/auth0-python/auth0/authentication/back_channel_login.pyi +++ /dev/null @@ -1,4 +0,0 @@ -from .base import AuthenticationBase as AuthenticationBase - -class BackChannelLogin(AuthenticationBase): - def back_channel_login(self, binding_message: str, login_hint: str, scope: str, **kwargs): ... diff --git a/stubs/auth0-python/auth0/authentication/base.pyi b/stubs/auth0-python/auth0/authentication/base.pyi deleted file mode 100644 index e67c3c414e00..000000000000 --- a/stubs/auth0-python/auth0/authentication/base.pyi +++ /dev/null @@ -1,31 +0,0 @@ -from _typeshed import Incomplete - -from auth0.rest import RestClient as RestClient, RestClientOptions as RestClientOptions -from auth0.types import RequestData as RequestData - -from .client_authentication import add_client_authentication as add_client_authentication - -UNKNOWN_ERROR: str - -class AuthenticationBase: - domain: Incomplete - client_id: Incomplete - client_secret: Incomplete - client_assertion_signing_key: Incomplete - client_assertion_signing_alg: Incomplete - protocol: Incomplete - client: Incomplete - def __init__( - self, - domain: str, - client_id: str, - client_secret: str | None = None, - client_assertion_signing_key: str | None = None, - client_assertion_signing_alg: str | None = None, - telemetry: bool = True, - timeout: float | tuple[float, float] = 5.0, - protocol: str = "https", - ) -> None: ... - def post(self, url: str, data: RequestData | None = None, headers: dict[str, str] | None = None): ... - def authenticated_post(self, url: str, data: dict[str, Incomplete], headers: dict[str, str] | None = None): ... - def get(self, url: str, params: dict[str, Incomplete] | None = None, headers: dict[str, str] | None = None): ... diff --git a/stubs/auth0-python/auth0/authentication/client_authentication.pyi b/stubs/auth0-python/auth0/authentication/client_authentication.pyi deleted file mode 100644 index e75647fe00f5..000000000000 --- a/stubs/auth0-python/auth0/authentication/client_authentication.pyi +++ /dev/null @@ -1,13 +0,0 @@ -from _typeshed import Incomplete - -def create_client_assertion_jwt( - domain: str, client_id: str, client_assertion_signing_key: str, client_assertion_signing_alg: str | None -) -> str: ... -def add_client_authentication( - payload: dict[str, Incomplete], - domain: str, - client_id: str, - client_secret: str | None, - client_assertion_signing_key: str | None, - client_assertion_signing_alg: str | None, -) -> dict[str, Incomplete]: ... diff --git a/stubs/auth0-python/auth0/authentication/delegated.pyi b/stubs/auth0-python/auth0/authentication/delegated.pyi deleted file mode 100644 index cedc50b05e6d..000000000000 --- a/stubs/auth0-python/auth0/authentication/delegated.pyi +++ /dev/null @@ -1,12 +0,0 @@ -from .base import AuthenticationBase as AuthenticationBase - -class Delegated(AuthenticationBase): - def get_token( - self, - target: str, - api_type: str, - grant_type: str, - id_token: str | None = None, - refresh_token: str | None = None, - scope: str = "openid", - ): ... diff --git a/stubs/auth0-python/auth0/authentication/enterprise.pyi b/stubs/auth0-python/auth0/authentication/enterprise.pyi deleted file mode 100644 index a438ec9a0fad..000000000000 --- a/stubs/auth0-python/auth0/authentication/enterprise.pyi +++ /dev/null @@ -1,5 +0,0 @@ -from .base import AuthenticationBase as AuthenticationBase - -class Enterprise(AuthenticationBase): - def saml_metadata(self): ... - def wsfed_metadata(self): ... diff --git a/stubs/auth0-python/auth0/authentication/get_token.pyi b/stubs/auth0-python/auth0/authentication/get_token.pyi deleted file mode 100644 index 64457306c40f..000000000000 --- a/stubs/auth0-python/auth0/authentication/get_token.pyi +++ /dev/null @@ -1,21 +0,0 @@ -from .base import AuthenticationBase as AuthenticationBase - -class GetToken(AuthenticationBase): - def authorization_code(self, code: str, redirect_uri: str | None, grant_type: str = "authorization_code"): ... - def authorization_code_pkce( - self, code_verifier: str, code: str, redirect_uri: str | None, grant_type: str = "authorization_code" - ): ... - def client_credentials(self, audience: str, grant_type: str = "client_credentials", organization: str | None = None): ... - def login( - self, - username: str, - password: str, - scope: str | None = None, - realm: str | None = None, - audience: str | None = None, - grant_type: str = "http://auth0.com/oauth/grant-type/password-realm", - forwarded_for: str | None = None, - ): ... - def refresh_token(self, refresh_token: str, scope: str = "", grant_type: str = "refresh_token"): ... - def passwordless_login(self, username: str, otp: str, realm: str, scope: str, audience: str): ... - def backchannel_login(self, auth_req_id: str, grant_type: str = "urn:openid:params:grant-type:ciba"): ... diff --git a/stubs/auth0-python/auth0/authentication/passwordless.pyi b/stubs/auth0-python/auth0/authentication/passwordless.pyi deleted file mode 100644 index 841c6f4fcc9c..000000000000 --- a/stubs/auth0-python/auth0/authentication/passwordless.pyi +++ /dev/null @@ -1,5 +0,0 @@ -from .base import AuthenticationBase as AuthenticationBase - -class Passwordless(AuthenticationBase): - def email(self, email: str, send: str = "link", auth_params: dict[str, str] | None = None): ... - def sms(self, phone_number: str): ... diff --git a/stubs/auth0-python/auth0/authentication/pushed_authorization_requests.pyi b/stubs/auth0-python/auth0/authentication/pushed_authorization_requests.pyi deleted file mode 100644 index 67bdc0074e35..000000000000 --- a/stubs/auth0-python/auth0/authentication/pushed_authorization_requests.pyi +++ /dev/null @@ -1,4 +0,0 @@ -from .base import AuthenticationBase as AuthenticationBase - -class PushedAuthorizationRequests(AuthenticationBase): - def pushed_authorization_request(self, response_type: str, redirect_uri: str, **kwargs): ... diff --git a/stubs/auth0-python/auth0/authentication/revoke_token.pyi b/stubs/auth0-python/auth0/authentication/revoke_token.pyi deleted file mode 100644 index 7190be6c6535..000000000000 --- a/stubs/auth0-python/auth0/authentication/revoke_token.pyi +++ /dev/null @@ -1,4 +0,0 @@ -from .base import AuthenticationBase as AuthenticationBase - -class RevokeToken(AuthenticationBase): - def revoke_refresh_token(self, token: str): ... diff --git a/stubs/auth0-python/auth0/authentication/social.pyi b/stubs/auth0-python/auth0/authentication/social.pyi deleted file mode 100644 index b63c702fd934..000000000000 --- a/stubs/auth0-python/auth0/authentication/social.pyi +++ /dev/null @@ -1,4 +0,0 @@ -from .base import AuthenticationBase as AuthenticationBase - -class Social(AuthenticationBase): - def login(self, access_token: str, connection: str, scope: str = "openid"): ... diff --git a/stubs/auth0-python/auth0/authentication/token_verifier.pyi b/stubs/auth0-python/auth0/authentication/token_verifier.pyi deleted file mode 100644 index c8c38ca3b0db..000000000000 --- a/stubs/auth0-python/auth0/authentication/token_verifier.pyi +++ /dev/null @@ -1,29 +0,0 @@ -from _typeshed import Incomplete -from typing import ClassVar - -from auth0.exceptions import TokenValidationError as TokenValidationError - -class SignatureVerifier: - DISABLE_JWT_CHECKS: ClassVar[dict[str, bool]] - def __init__(self, algorithm: str) -> None: ... - async def verify_signature(self, token: str) -> dict[str, Incomplete]: ... - -class SymmetricSignatureVerifier(SignatureVerifier): - def __init__(self, shared_secret: str, algorithm: str = "HS256") -> None: ... - -class JwksFetcher: - CACHE_TTL: ClassVar[int] - def __init__(self, jwks_url: str, cache_ttl: int = ...) -> None: ... - def get_key(self, key_id: str): ... - -class AsymmetricSignatureVerifier(SignatureVerifier): - def __init__(self, jwks_url: str, algorithm: str = "RS256", cache_ttl: int = ...) -> None: ... - -class TokenVerifier: - iss: Incomplete - aud: Incomplete - leeway: Incomplete - def __init__(self, signature_verifier: SignatureVerifier, issuer: str, audience: str, leeway: int = 0) -> None: ... - def verify( - self, token: str, nonce: str | None = None, max_age: int | None = None, organization: str | None = None - ) -> dict[str, Incomplete]: ... diff --git a/stubs/auth0-python/auth0/authentication/users.pyi b/stubs/auth0-python/auth0/authentication/users.pyi deleted file mode 100644 index c5a15db5221b..000000000000 --- a/stubs/auth0-python/auth0/authentication/users.pyi +++ /dev/null @@ -1,11 +0,0 @@ -from _typeshed import Incomplete - -from auth0.rest import RestClient as RestClient, RestClientOptions as RestClientOptions -from auth0.types import TimeoutType as TimeoutType - -class Users: - domain: Incomplete - protocol: Incomplete - client: Incomplete - def __init__(self, domain: str, telemetry: bool = True, timeout: TimeoutType = 5.0, protocol: str = "https") -> None: ... - def userinfo(self, access_token: str) -> dict[str, Incomplete]: ... diff --git a/stubs/auth0-python/auth0/exceptions.pyi b/stubs/auth0-python/auth0/exceptions.pyi deleted file mode 100644 index f500aad795bc..000000000000 --- a/stubs/auth0-python/auth0/exceptions.pyi +++ /dev/null @@ -1,14 +0,0 @@ -from _typeshed import Incomplete - -class Auth0Error(Exception): - status_code: Incomplete - error_code: Incomplete - message: Incomplete - content: Incomplete - def __init__(self, status_code: int, error_code: str, message: str, content: Incomplete | None = None) -> None: ... - -class RateLimitError(Auth0Error): - reset_at: Incomplete - def __init__(self, error_code: str, message: str, reset_at: int) -> None: ... - -class TokenValidationError(Exception): ... diff --git a/stubs/auth0-python/auth0/management/__init__.pyi b/stubs/auth0-python/auth0/management/__init__.pyi deleted file mode 100644 index 37f4aa7c2067..000000000000 --- a/stubs/auth0-python/auth0/management/__init__.pyi +++ /dev/null @@ -1,63 +0,0 @@ -from .actions import Actions as Actions -from .attack_protection import AttackProtection as AttackProtection -from .auth0 import Auth0 as Auth0 -from .blacklists import Blacklists as Blacklists -from .branding import Branding as Branding -from .client_credentials import ClientCredentials as ClientCredentials -from .client_grants import ClientGrants as ClientGrants -from .clients import Clients as Clients -from .connections import Connections as Connections -from .custom_domains import CustomDomains as CustomDomains -from .device_credentials import DeviceCredentials as DeviceCredentials -from .email_templates import EmailTemplates as EmailTemplates -from .emails import Emails as Emails -from .grants import Grants as Grants -from .guardian import Guardian as Guardian -from .hooks import Hooks as Hooks -from .jobs import Jobs as Jobs -from .log_streams import LogStreams as LogStreams -from .logs import Logs as Logs -from .organizations import Organizations as Organizations -from .resource_servers import ResourceServers as ResourceServers -from .roles import Roles as Roles -from .rules import Rules as Rules -from .rules_configs import RulesConfigs as RulesConfigs -from .stats import Stats as Stats -from .tenants import Tenants as Tenants -from .tickets import Tickets as Tickets -from .user_blocks import UserBlocks as UserBlocks -from .users import Users as Users -from .users_by_email import UsersByEmail as UsersByEmail - -__all__ = ( - "Auth0", - "Actions", - "AttackProtection", - "Blacklists", - "Branding", - "ClientCredentials", - "ClientGrants", - "Clients", - "Connections", - "CustomDomains", - "DeviceCredentials", - "EmailTemplates", - "Emails", - "Grants", - "Guardian", - "Hooks", - "Jobs", - "LogStreams", - "Logs", - "Organizations", - "ResourceServers", - "Roles", - "RulesConfigs", - "Rules", - "Stats", - "Tenants", - "Tickets", - "UserBlocks", - "UsersByEmail", - "Users", -) diff --git a/stubs/auth0-python/auth0/management/actions.pyi b/stubs/auth0-python/auth0/management/actions.pyi deleted file mode 100644 index bce092dff25e..000000000000 --- a/stubs/auth0-python/auth0/management/actions.pyi +++ /dev/null @@ -1,64 +0,0 @@ -from _typeshed import Incomplete - -from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions -from ..types import TimeoutType as TimeoutType - -class Actions: - domain: Incomplete - protocol: Incomplete - client: Incomplete - def __init__( - self, - domain: str, - token: str, - telemetry: bool = True, - timeout: TimeoutType = 5.0, - protocol: str = "https", - rest_options: RestClientOptions | None = None, - ) -> None: ... - def get_actions( - self, - trigger_id: str | None = None, - action_name: str | None = None, - deployed: bool | None = None, - installed: bool = False, - page: int | None = None, - per_page: int | None = None, - ): ... - async def get_actions_async( - self, - trigger_id: str | None = None, - action_name: str | None = None, - deployed: bool | None = None, - installed: bool = False, - page: int | None = None, - per_page: int | None = None, - ): ... - def create_action(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def create_action_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - def update_action(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def update_action_async(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - def get_action(self, id: str) -> dict[str, Incomplete]: ... - async def get_action_async(self, id: str) -> dict[str, Incomplete]: ... - def delete_action(self, id: str, force: bool = False): ... - async def delete_action_async(self, id: str, force: bool = False): ... - def get_triggers(self) -> dict[str, Incomplete]: ... - async def get_triggers_async(self) -> dict[str, Incomplete]: ... - def get_execution(self, id: str) -> dict[str, Incomplete]: ... - async def get_execution_async(self, id: str) -> dict[str, Incomplete]: ... - def get_action_versions(self, id: str, page: int | None = None, per_page: int | None = None) -> dict[str, Incomplete]: ... - async def get_action_versions_async( - self, id: str, page: int | None = None, per_page: int | None = None - ) -> dict[str, Incomplete]: ... - def get_trigger_bindings(self, id: str, page: int | None = None, per_page: int | None = None) -> dict[str, Incomplete]: ... - async def get_trigger_bindings_async( - self, id: str, page: int | None = None, per_page: int | None = None - ) -> dict[str, Incomplete]: ... - def get_action_version(self, action_id: str, version_id: str) -> dict[str, Incomplete]: ... - async def get_action_version_async(self, action_id: str, version_id: str) -> dict[str, Incomplete]: ... - def deploy_action(self, id: str) -> dict[str, Incomplete]: ... - async def deploy_action_async(self, id: str) -> dict[str, Incomplete]: ... - def rollback_action_version(self, action_id: str, version_id: str) -> dict[str, Incomplete]: ... - async def rollback_action_version_async(self, action_id: str, version_id: str) -> dict[str, Incomplete]: ... - def update_trigger_bindings(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def update_trigger_bindings_async(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... diff --git a/stubs/auth0-python/auth0/management/async_auth0.pyi b/stubs/auth0-python/auth0/management/async_auth0.pyi index 6b3f78886ca1..4e5f34c430ef 100644 --- a/stubs/auth0-python/auth0/management/async_auth0.pyi +++ b/stubs/auth0-python/auth0/management/async_auth0.pyi @@ -1,15 +1,77 @@ from types import TracebackType from typing_extensions import Self -from auth0.rest import RestClientOptions as RestClientOptions +import aiohttp +from auth0.rest import RestClientOptions -from ..asyncify import asyncify as asyncify -from .auth0 import Auth0 as Auth0 +# Relative import climbs too many namespaces +from .._asyncified.management.actions import _ActionsAsync # type: ignore[misc] +from .._asyncified.management.attack_protection import _AttackProtectionAsync # type: ignore[misc] +from .._asyncified.management.blacklists import _BlacklistsAsync # type: ignore[misc] +from .._asyncified.management.branding import _BrandingAsync # type: ignore[misc] +from .._asyncified.management.client_credentials import _ClientCredentialsAsync # type: ignore[misc] +from .._asyncified.management.client_grants import _ClientGrantsAsync # type: ignore[misc] +from .._asyncified.management.clients import _ClientsAsync # type: ignore[misc] +from .._asyncified.management.connections import _ConnectionsAsync # type: ignore[misc] +from .._asyncified.management.custom_domains import _CustomDomainsAsync # type: ignore[misc] +from .._asyncified.management.device_credentials import _DeviceCredentialsAsync # type: ignore[misc] +from .._asyncified.management.email_templates import _EmailTemplatesAsync # type: ignore[misc] +from .._asyncified.management.emails import _EmailsAsync # type: ignore[misc] +from .._asyncified.management.grants import _GrantsAsync # type: ignore[misc] +from .._asyncified.management.guardian import _GuardianAsync # type: ignore[misc] +from .._asyncified.management.hooks import _HooksAsync # type: ignore[misc] +from .._asyncified.management.jobs import _JobsAsync # type: ignore[misc] +from .._asyncified.management.log_streams import _LogStreamsAsync # type: ignore[misc] +from .._asyncified.management.logs import _LogsAsync # type: ignore[misc] +from .._asyncified.management.organizations import _OrganizationsAsync # type: ignore[misc] +from .._asyncified.management.prompts import _PromptsAsync # type: ignore[misc] +from .._asyncified.management.resource_servers import _ResourceServersAsync # type: ignore[misc] +from .._asyncified.management.roles import _RolesAsync # type: ignore[misc] +from .._asyncified.management.rules import _RulesAsync # type: ignore[misc] +from .._asyncified.management.rules_configs import _RulesConfigsAsync # type: ignore[misc] +from .._asyncified.management.stats import _StatsAsync # type: ignore[misc] +from .._asyncified.management.tenants import _TenantsAsync # type: ignore[misc] +from .._asyncified.management.tickets import _TicketsAsync # type: ignore[misc] +from .._asyncified.management.user_blocks import _UserBlocksAsync # type: ignore[misc] +from .._asyncified.management.users import _UsersAsync # type: ignore[misc] +from .._asyncified.management.users_by_email import _UsersByEmailAsync # type: ignore[misc] class AsyncAuth0: def __init__(self, domain: str, token: str, rest_options: RestClientOptions | None = None) -> None: ... - def set_session(self, session) -> None: ... + def set_session(self, session: aiohttp.ClientSession) -> None: ... async def __aenter__(self) -> Self: ... async def __aexit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None ) -> None: ... + + # Same as Auth0, but async + actions: _ActionsAsync + attack_protection: _AttackProtectionAsync + blacklists: _BlacklistsAsync + branding: _BrandingAsync + client_credentials: _ClientCredentialsAsync + client_grants: _ClientGrantsAsync + clients: _ClientsAsync + connections: _ConnectionsAsync + custom_domains: _CustomDomainsAsync + device_credentials: _DeviceCredentialsAsync + email_templates: _EmailTemplatesAsync + emails: _EmailsAsync + grants: _GrantsAsync + guardian: _GuardianAsync + hooks: _HooksAsync + jobs: _JobsAsync + log_streams: _LogStreamsAsync + logs: _LogsAsync + organizations: _OrganizationsAsync + prompts: _PromptsAsync + resource_servers: _ResourceServersAsync + roles: _RolesAsync + rules_configs: _RulesConfigsAsync + rules: _RulesAsync + stats: _StatsAsync + tenants: _TenantsAsync + tickets: _TicketsAsync + user_blocks: _UserBlocksAsync + users_by_email: _UsersByEmailAsync + users: _UsersAsync diff --git a/stubs/auth0-python/auth0/management/attack_protection.pyi b/stubs/auth0-python/auth0/management/attack_protection.pyi deleted file mode 100644 index d84ecc180939..000000000000 --- a/stubs/auth0-python/auth0/management/attack_protection.pyi +++ /dev/null @@ -1,30 +0,0 @@ -from _typeshed import Incomplete - -from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions -from ..types import TimeoutType as TimeoutType - -class AttackProtection: - domain: Incomplete - protocol: Incomplete - client: Incomplete - def __init__( - self, - domain: str, - token: str, - telemetry: bool = True, - timeout: TimeoutType = 5.0, - protocol: str = "https", - rest_options: RestClientOptions | None = None, - ) -> None: ... - def get_breached_password_detection(self) -> dict[str, Incomplete]: ... - async def get_breached_password_detection_async(self) -> dict[str, Incomplete]: ... - def update_breached_password_detection(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def update_breached_password_detection_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - def get_brute_force_protection(self) -> dict[str, Incomplete]: ... - async def get_brute_force_protection_async(self) -> dict[str, Incomplete]: ... - def update_brute_force_protection(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def update_brute_force_protection_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - def get_suspicious_ip_throttling(self) -> dict[str, Incomplete]: ... - async def get_suspicious_ip_throttling_async(self) -> dict[str, Incomplete]: ... - def update_suspicious_ip_throttling(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def update_suspicious_ip_throttling_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... diff --git a/stubs/auth0-python/auth0/management/auth0.pyi b/stubs/auth0-python/auth0/management/auth0.pyi deleted file mode 100644 index 14f7e64caa38..000000000000 --- a/stubs/auth0-python/auth0/management/auth0.pyi +++ /dev/null @@ -1,67 +0,0 @@ -from _typeshed import Incomplete - -from auth0.rest import RestClientOptions as RestClientOptions - -from .actions import Actions as Actions -from .attack_protection import AttackProtection as AttackProtection -from .blacklists import Blacklists as Blacklists -from .branding import Branding as Branding -from .client_credentials import ClientCredentials as ClientCredentials -from .client_grants import ClientGrants as ClientGrants -from .clients import Clients as Clients -from .connections import Connections as Connections -from .custom_domains import CustomDomains as CustomDomains -from .device_credentials import DeviceCredentials as DeviceCredentials -from .email_templates import EmailTemplates as EmailTemplates -from .emails import Emails as Emails -from .grants import Grants as Grants -from .guardian import Guardian as Guardian -from .hooks import Hooks as Hooks -from .jobs import Jobs as Jobs -from .log_streams import LogStreams as LogStreams -from .logs import Logs as Logs -from .organizations import Organizations as Organizations -from .prompts import Prompts as Prompts -from .resource_servers import ResourceServers as ResourceServers -from .roles import Roles as Roles -from .rules import Rules as Rules -from .rules_configs import RulesConfigs as RulesConfigs -from .stats import Stats as Stats -from .tenants import Tenants as Tenants -from .tickets import Tickets as Tickets -from .user_blocks import UserBlocks as UserBlocks -from .users import Users as Users -from .users_by_email import UsersByEmail as UsersByEmail - -class Auth0: - actions: Incomplete - attack_protection: Incomplete - blacklists: Incomplete - branding: Incomplete - client_credentials: Incomplete - client_grants: Incomplete - clients: Incomplete - connections: Incomplete - custom_domains: Incomplete - device_credentials: Incomplete - email_templates: Incomplete - emails: Incomplete - grants: Incomplete - guardian: Incomplete - hooks: Incomplete - jobs: Incomplete - log_streams: Incomplete - logs: Incomplete - organizations: Incomplete - prompts: Incomplete - resource_servers: Incomplete - roles: Incomplete - rules_configs: Incomplete - rules: Incomplete - stats: Incomplete - tenants: Incomplete - tickets: Incomplete - user_blocks: Incomplete - users_by_email: Incomplete - users: Incomplete - def __init__(self, domain: str, token: str, rest_options: RestClientOptions | None = None) -> None: ... diff --git a/stubs/auth0-python/auth0/management/blacklists.pyi b/stubs/auth0-python/auth0/management/blacklists.pyi deleted file mode 100644 index 9baf22376176..000000000000 --- a/stubs/auth0-python/auth0/management/blacklists.pyi +++ /dev/null @@ -1,21 +0,0 @@ -from _typeshed import Incomplete - -from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions -from ..types import TimeoutType as TimeoutType - -class Blacklists: - url: Incomplete - client: Incomplete - def __init__( - self, - domain: str, - token: str, - telemetry: bool = True, - timeout: TimeoutType = 5.0, - protocol: str = "https", - rest_options: RestClientOptions | None = None, - ) -> None: ... - def get(self, aud: str | None = None) -> list[dict[str, str]]: ... - async def get_async(self, aud: str | None = None) -> list[dict[str, str]]: ... - def create(self, jti: str, aud: str | None = None) -> dict[str, str]: ... - async def create_async(self, jti: str, aud: str | None = None) -> dict[str, str]: ... diff --git a/stubs/auth0-python/auth0/management/branding.pyi b/stubs/auth0-python/auth0/management/branding.pyi deleted file mode 100644 index 71be39cf4b6b..000000000000 --- a/stubs/auth0-python/auth0/management/branding.pyi +++ /dev/null @@ -1,38 +0,0 @@ -from _typeshed import Incomplete - -from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions -from ..types import TimeoutType as TimeoutType - -class Branding: - domain: Incomplete - protocol: Incomplete - client: Incomplete - def __init__( - self, - domain: str, - token: str, - telemetry: bool = True, - timeout: TimeoutType = 5.0, - protocol: str = "https", - rest_options: RestClientOptions | None = None, - ) -> None: ... - def get(self) -> dict[str, Incomplete]: ... - async def get_async(self) -> dict[str, Incomplete]: ... - def update(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def update_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - def get_template_universal_login(self) -> dict[str, Incomplete]: ... - async def get_template_universal_login_async(self) -> dict[str, Incomplete]: ... - def delete_template_universal_login(self): ... - async def delete_template_universal_login_async(self): ... - def update_template_universal_login(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def update_template_universal_login_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - def get_default_branding_theme(self) -> dict[str, Incomplete]: ... - async def get_default_branding_theme_async(self) -> dict[str, Incomplete]: ... - def get_branding_theme(self, theme_id: str) -> dict[str, Incomplete]: ... - async def get_branding_theme_async(self, theme_id: str) -> dict[str, Incomplete]: ... - def delete_branding_theme(self, theme_id: str): ... - async def delete_branding_theme_async(self, theme_id: str): ... - def update_branding_theme(self, theme_id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def update_branding_theme_async(self, theme_id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - def create_branding_theme(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def create_branding_theme_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... diff --git a/stubs/auth0-python/auth0/management/client_credentials.pyi b/stubs/auth0-python/auth0/management/client_credentials.pyi deleted file mode 100644 index 895f79bcc5ee..000000000000 --- a/stubs/auth0-python/auth0/management/client_credentials.pyi +++ /dev/null @@ -1,26 +0,0 @@ -from _typeshed import Incomplete - -from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions -from ..types import TimeoutType as TimeoutType - -class ClientCredentials: - domain: Incomplete - protocol: Incomplete - client: Incomplete - def __init__( - self, - domain: str, - token: str, - telemetry: bool = True, - timeout: TimeoutType = 5.0, - protocol: str = "https", - rest_options: RestClientOptions | None = None, - ) -> None: ... - def all(self, client_id: str) -> list[dict[str, Incomplete]]: ... - async def all_async(self, client_id: str) -> list[dict[str, Incomplete]]: ... - def get(self, client_id: str, id: str) -> dict[str, Incomplete]: ... - async def get_async(self, client_id: str, id: str) -> dict[str, Incomplete]: ... - def create(self, client_id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def create_async(self, client_id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - def delete(self, client_id: str, id: str) -> dict[str, Incomplete]: ... - async def delete_async(self, client_id: str, id: str) -> dict[str, Incomplete]: ... diff --git a/stubs/auth0-python/auth0/management/client_grants.pyi b/stubs/auth0-python/auth0/management/client_grants.pyi deleted file mode 100644 index bae2e974df3c..000000000000 --- a/stubs/auth0-python/auth0/management/client_grants.pyi +++ /dev/null @@ -1,60 +0,0 @@ -from _typeshed import Incomplete - -from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions -from ..types import TimeoutType as TimeoutType - -class ClientGrants: - domain: Incomplete - protocol: Incomplete - client: Incomplete - def __init__( - self, - domain: str, - token: str, - telemetry: bool = True, - timeout: TimeoutType = 5.0, - protocol: str = "https", - rest_options: RestClientOptions | None = None, - ) -> None: ... - def all( - self, - audience: str | None = None, - page: int | None = None, - per_page: int | None = None, - include_totals: bool = False, - client_id: str | None = None, - allow_any_organization: bool | None = None, - ) -> dict[str, Incomplete]: ... - async def all_async( - self, - audience: str | None = None, - page: int | None = None, - per_page: int | None = None, - include_totals: bool = False, - client_id: str | None = None, - allow_any_organization: bool | None = None, - ) -> dict[str, Incomplete]: ... - def create(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def create_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - def delete(self, id: str): ... - async def delete_async(self, id: str): ... - def update(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def update_async(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - def get_organizations( - self, - id: str, - page: int | None = None, - per_page: int | None = None, - include_totals: bool = False, - from_param: str | None = None, - take: int | None = None, - ) -> dict[str, Incomplete]: ... - async def get_organizations_async( - self, - id: str, - page: int | None = None, - per_page: int | None = None, - include_totals: bool = False, - from_param: str | None = None, - take: int | None = None, - ) -> dict[str, Incomplete]: ... diff --git a/stubs/auth0-python/auth0/management/clients.pyi b/stubs/auth0-python/auth0/management/clients.pyi deleted file mode 100644 index 1144a33b3dff..000000000000 --- a/stubs/auth0-python/auth0/management/clients.pyi +++ /dev/null @@ -1,44 +0,0 @@ -from _typeshed import Incomplete - -from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions -from ..types import TimeoutType as TimeoutType - -class Clients: - domain: Incomplete - protocol: Incomplete - client: Incomplete - def __init__( - self, - domain: str, - token: str, - telemetry: bool = True, - timeout: TimeoutType = 5.0, - protocol: str = "https", - rest_options: RestClientOptions | None = None, - ) -> None: ... - def all( - self, - fields: list[str] | None = None, - include_fields: bool = True, - page: int | None = None, - per_page: int | None = None, - extra_params: dict[str, Incomplete] | None = None, - ) -> list[dict[str, Incomplete]]: ... - async def all_async( - self, - fields: list[str] | None = None, - include_fields: bool = True, - page: int | None = None, - per_page: int | None = None, - extra_params: dict[str, Incomplete] | None = None, - ) -> list[dict[str, Incomplete]]: ... - def create(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def create_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - def get(self, id: str, fields: list[str] | None = None, include_fields: bool = True) -> dict[str, Incomplete]: ... - async def get_async(self, id: str, fields: list[str] | None = None, include_fields: bool = True) -> dict[str, Incomplete]: ... - def delete(self, id: str): ... - async def delete_async(self, id: str): ... - def update(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def update_async(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - def rotate_secret(self, id: str) -> dict[str, Incomplete]: ... - async def rotate_secret_async(self, id: str) -> dict[str, Incomplete]: ... diff --git a/stubs/auth0-python/auth0/management/connections.pyi b/stubs/auth0-python/auth0/management/connections.pyi deleted file mode 100644 index a7b53124c8e6..000000000000 --- a/stubs/auth0-python/auth0/management/connections.pyi +++ /dev/null @@ -1,48 +0,0 @@ -from _typeshed import Incomplete - -from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions -from ..types import TimeoutType as TimeoutType - -class Connections: - domain: Incomplete - protocol: Incomplete - client: Incomplete - def __init__( - self, - domain: str, - token: str, - telemetry: bool = True, - timeout: TimeoutType = 5.0, - protocol: str = "https", - rest_options: RestClientOptions | None = None, - ) -> None: ... - def all( - self, - strategy: str | None = None, - fields: list[str] | None = None, - include_fields: bool = True, - page: int | None = None, - per_page: int | None = None, - extra_params: dict[str, Incomplete] | None = None, - name: str | None = None, - ) -> list[dict[str, Incomplete]]: ... - async def all_async( - self, - strategy: str | None = None, - fields: list[str] | None = None, - include_fields: bool = True, - page: int | None = None, - per_page: int | None = None, - extra_params: dict[str, Incomplete] | None = None, - name: str | None = None, - ) -> list[dict[str, Incomplete]]: ... - def get(self, id: str, fields: list[str] | None = None, include_fields: bool = True) -> dict[str, Incomplete]: ... - async def get_async(self, id: str, fields: list[str] | None = None, include_fields: bool = True) -> dict[str, Incomplete]: ... - def delete(self, id: str): ... - async def delete_async(self, id: str): ... - def update(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def update_async(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - def create(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def create_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - def delete_user_by_email(self, id: str, email: str): ... - async def delete_user_by_email_async(self, id: str, email: str): ... diff --git a/stubs/auth0-python/auth0/management/custom_domains.pyi b/stubs/auth0-python/auth0/management/custom_domains.pyi deleted file mode 100644 index 84b0a1859cb0..000000000000 --- a/stubs/auth0-python/auth0/management/custom_domains.pyi +++ /dev/null @@ -1,28 +0,0 @@ -from _typeshed import Incomplete - -from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions -from ..types import TimeoutType as TimeoutType - -class CustomDomains: - domain: Incomplete - protocol: Incomplete - client: Incomplete - def __init__( - self, - domain: str, - token: str, - telemetry: bool = True, - timeout: TimeoutType = 5.0, - protocol: str = "https", - rest_options: RestClientOptions | None = None, - ) -> None: ... - def all(self) -> list[dict[str, Incomplete]]: ... - async def all_async(self) -> list[dict[str, Incomplete]]: ... - def get(self, id: str) -> dict[str, Incomplete]: ... - async def get_async(self, id: str) -> dict[str, Incomplete]: ... - def delete(self, id: str): ... - async def delete_async(self, id: str): ... - def create_new(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def create_new_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - def verify(self, id: str) -> dict[str, Incomplete]: ... - async def verify_async(self, id: str) -> dict[str, Incomplete]: ... diff --git a/stubs/auth0-python/auth0/management/device_credentials.pyi b/stubs/auth0-python/auth0/management/device_credentials.pyi deleted file mode 100644 index 3d1f8e4f3a1b..000000000000 --- a/stubs/auth0-python/auth0/management/device_credentials.pyi +++ /dev/null @@ -1,44 +0,0 @@ -from _typeshed import Incomplete - -from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions -from ..types import TimeoutType as TimeoutType - -class DeviceCredentials: - domain: Incomplete - protocol: Incomplete - client: Incomplete - def __init__( - self, - domain: str, - token: str, - telemetry: bool = True, - timeout: TimeoutType = 5.0, - protocol: str = "https", - rest_options: RestClientOptions | None = None, - ) -> None: ... - def get( - self, - user_id: str, - client_id: str, - type: str, - fields: list[str] | None = None, - include_fields: bool = True, - page: int | None = None, - per_page: int | None = None, - include_totals: bool = False, - ): ... - async def get_async( - self, - user_id: str, - client_id: str, - type: str, - fields: list[str] | None = None, - include_fields: bool = True, - page: int | None = None, - per_page: int | None = None, - include_totals: bool = False, - ): ... - def create(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def create_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - def delete(self, id: str): ... - async def delete_async(self, id: str): ... diff --git a/stubs/auth0-python/auth0/management/email_templates.pyi b/stubs/auth0-python/auth0/management/email_templates.pyi deleted file mode 100644 index 9a4e8919da65..000000000000 --- a/stubs/auth0-python/auth0/management/email_templates.pyi +++ /dev/null @@ -1,24 +0,0 @@ -from _typeshed import Incomplete - -from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions -from ..types import TimeoutType as TimeoutType - -class EmailTemplates: - domain: Incomplete - protocol: Incomplete - client: Incomplete - def __init__( - self, - domain: str, - token: str, - telemetry: bool = True, - timeout: TimeoutType = 5.0, - protocol: str = "https", - rest_options: RestClientOptions | None = None, - ) -> None: ... - def create(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def create_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - def get(self, template_name: str) -> dict[str, Incomplete]: ... - async def get_async(self, template_name: str) -> dict[str, Incomplete]: ... - def update(self, template_name: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def update_async(self, template_name: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... diff --git a/stubs/auth0-python/auth0/management/emails.pyi b/stubs/auth0-python/auth0/management/emails.pyi deleted file mode 100644 index f681b1ea9150..000000000000 --- a/stubs/auth0-python/auth0/management/emails.pyi +++ /dev/null @@ -1,26 +0,0 @@ -from _typeshed import Incomplete - -from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions -from ..types import TimeoutType as TimeoutType - -class Emails: - domain: Incomplete - protocol: Incomplete - client: Incomplete - def __init__( - self, - domain: str, - token: str, - telemetry: bool = True, - timeout: TimeoutType = 5.0, - protocol: str = "https", - rest_options: RestClientOptions | None = None, - ) -> None: ... - def get(self, fields: list[str] | None = None, include_fields: bool = True) -> dict[str, Incomplete]: ... - async def get_async(self, fields: list[str] | None = None, include_fields: bool = True) -> dict[str, Incomplete]: ... - def config(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def config_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - def delete(self): ... - async def delete_async(self): ... - def update(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def update_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... diff --git a/stubs/auth0-python/auth0/management/grants.pyi b/stubs/auth0-python/auth0/management/grants.pyi deleted file mode 100644 index e7946afc5a65..000000000000 --- a/stubs/auth0-python/auth0/management/grants.pyi +++ /dev/null @@ -1,34 +0,0 @@ -from _typeshed import Incomplete - -from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions -from ..types import TimeoutType as TimeoutType - -class Grants: - domain: Incomplete - protocol: Incomplete - client: Incomplete - def __init__( - self, - domain: str, - token: str, - telemetry: bool = True, - timeout: TimeoutType = 5.0, - protocol: str = "https", - rest_options: RestClientOptions | None = None, - ) -> None: ... - def all( - self, - page: int | None = None, - per_page: int | None = None, - include_totals: bool = False, - extra_params: dict[str, Incomplete] | None = None, - ): ... - async def all_async( - self, - page: int | None = None, - per_page: int | None = None, - include_totals: bool = False, - extra_params: dict[str, Incomplete] | None = None, - ): ... - def delete(self, id: str): ... - async def delete_async(self, id: str): ... diff --git a/stubs/auth0-python/auth0/management/guardian.pyi b/stubs/auth0-python/auth0/management/guardian.pyi deleted file mode 100644 index 19e46a0e238e..000000000000 --- a/stubs/auth0-python/auth0/management/guardian.pyi +++ /dev/null @@ -1,38 +0,0 @@ -from _typeshed import Incomplete - -from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions -from ..types import TimeoutType as TimeoutType - -class Guardian: - domain: Incomplete - protocol: Incomplete - client: Incomplete - def __init__( - self, - domain: str, - token: str, - telemetry: bool = True, - timeout: TimeoutType = 5.0, - protocol: str = "https", - rest_options: RestClientOptions | None = None, - ) -> None: ... - def all_factors(self) -> list[dict[str, Incomplete]]: ... - async def all_factors_async(self) -> list[dict[str, Incomplete]]: ... - def update_factor(self, name: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def update_factor_async(self, name: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - def update_templates(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def update_templates_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - def get_templates(self) -> dict[str, Incomplete]: ... - async def get_templates_async(self) -> dict[str, Incomplete]: ... - def get_enrollment(self, id: str) -> dict[str, Incomplete]: ... - async def get_enrollment_async(self, id: str) -> dict[str, Incomplete]: ... - def delete_enrollment(self, id: str): ... - async def delete_enrollment_async(self, id: str): ... - def create_enrollment_ticket(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def create_enrollment_ticket_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - def get_factor_providers(self, factor_name: str, name: str) -> dict[str, Incomplete]: ... - async def get_factor_providers_async(self, factor_name: str, name: str) -> dict[str, Incomplete]: ... - def update_factor_providers(self, factor_name: str, name: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def update_factor_providers_async( - self, factor_name: str, name: str, body: dict[str, Incomplete] - ) -> dict[str, Incomplete]: ... diff --git a/stubs/auth0-python/auth0/management/hooks.pyi b/stubs/auth0-python/auth0/management/hooks.pyi deleted file mode 100644 index 37ceddff41b6..000000000000 --- a/stubs/auth0-python/auth0/management/hooks.pyi +++ /dev/null @@ -1,52 +0,0 @@ -from _typeshed import Incomplete - -from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions -from ..types import TimeoutType as TimeoutType - -class Hooks: - domain: Incomplete - protocol: Incomplete - client: Incomplete - def __init__( - self, - domain: str, - token: str, - telemetry: bool = True, - timeout: TimeoutType = 5.0, - protocol: str = "https", - rest_options: RestClientOptions | None = None, - ) -> None: ... - def all( - self, - enabled: bool = True, - fields: list[str] | None = None, - include_fields: bool = True, - page: int | None = None, - per_page: int | None = None, - include_totals: bool = False, - ): ... - async def all_async( - self, - enabled: bool = True, - fields: list[str] | None = None, - include_fields: bool = True, - page: int | None = None, - per_page: int | None = None, - include_totals: bool = False, - ): ... - def create(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def create_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - def get(self, id: str, fields: list[str] | None = None) -> dict[str, Incomplete]: ... - async def get_async(self, id: str, fields: list[str] | None = None) -> dict[str, Incomplete]: ... - def delete(self, id: str): ... - async def delete_async(self, id: str): ... - def update(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def update_async(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - def get_secrets(self, id: str) -> dict[str, Incomplete]: ... - async def get_secrets_async(self, id: str) -> dict[str, Incomplete]: ... - def add_secrets(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def add_secrets_async(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - def delete_secrets(self, id: str, body: list[str]): ... - async def delete_secrets_async(self, id: str, body: list[str]): ... - def update_secrets(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def update_secrets_async(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... diff --git a/stubs/auth0-python/auth0/management/jobs.pyi b/stubs/auth0-python/auth0/management/jobs.pyi deleted file mode 100644 index 7ac7699525ba..000000000000 --- a/stubs/auth0-python/auth0/management/jobs.pyi +++ /dev/null @@ -1,42 +0,0 @@ -from _typeshed import Incomplete - -from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions -from ..types import TimeoutType as TimeoutType - -class Jobs: - domain: Incomplete - protocol: Incomplete - client: Incomplete - def __init__( - self, - domain: str, - token: str, - telemetry: bool = True, - timeout: TimeoutType = 5.0, - protocol: str = "https", - rest_options: RestClientOptions | None = None, - ) -> None: ... - def get(self, id: str) -> dict[str, Incomplete]: ... - async def get_async(self, id: str) -> dict[str, Incomplete]: ... - def get_failed_job(self, id: str) -> dict[str, Incomplete]: ... - async def get_failed_job_async(self, id: str) -> dict[str, Incomplete]: ... - def export_users(self, body: dict[str, Incomplete]): ... - async def export_users_async(self, body: dict[str, Incomplete]): ... - def import_users( - self, - connection_id: str, - file_obj, - upsert: bool = False, - send_completion_email: bool = True, - external_id: str | None = None, - ) -> dict[str, Incomplete]: ... - async def import_users_async( - self, - connection_id: str, - file_obj, - upsert: bool = False, - send_completion_email: bool = True, - external_id: str | None = None, - ) -> dict[str, Incomplete]: ... - def send_verification_email(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def send_verification_email_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... diff --git a/stubs/auth0-python/auth0/management/log_streams.pyi b/stubs/auth0-python/auth0/management/log_streams.pyi deleted file mode 100644 index 85dcd922690a..000000000000 --- a/stubs/auth0-python/auth0/management/log_streams.pyi +++ /dev/null @@ -1,29 +0,0 @@ -from _typeshed import Incomplete -from builtins import list as _list - -from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions -from ..types import TimeoutType as TimeoutType - -class LogStreams: - domain: Incomplete - protocol: Incomplete - client: Incomplete - def __init__( - self, - domain: str, - token: str, - telemetry: bool = True, - timeout: TimeoutType = 5.0, - protocol: str = "https", - rest_options: RestClientOptions | None = None, - ) -> None: ... - def list(self) -> _list[dict[str, Incomplete]]: ... - async def list_async(self) -> _list[dict[str, Incomplete]]: ... - def get(self, id: str) -> dict[str, Incomplete]: ... - async def get_async(self, id: str) -> dict[str, Incomplete]: ... - def create(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def create_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - def delete(self, id: str) -> dict[str, Incomplete]: ... - async def delete_async(self, id: str) -> dict[str, Incomplete]: ... - def update(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def update_async(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... diff --git a/stubs/auth0-python/auth0/management/logs.pyi b/stubs/auth0-python/auth0/management/logs.pyi deleted file mode 100644 index a5ac9e4c74b7..000000000000 --- a/stubs/auth0-python/auth0/management/logs.pyi +++ /dev/null @@ -1,44 +0,0 @@ -from _typeshed import Incomplete - -from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions -from ..types import TimeoutType as TimeoutType - -class Logs: - domain: Incomplete - protocol: Incomplete - client: Incomplete - def __init__( - self, - domain: str, - token: str, - telemetry: bool = True, - timeout: TimeoutType = 5.0, - protocol: str = "https", - rest_options: RestClientOptions | None = None, - ) -> None: ... - def search( - self, - page: int = 0, - per_page: int = 50, - sort: str | None = None, - q: str | None = None, - include_totals: bool = True, - fields: list[str] | None = None, - from_param: str | None = None, - take: int | None = None, - include_fields: bool = True, - ) -> dict[str, Incomplete]: ... - async def search_async( - self, - page: int = 0, - per_page: int = 50, - sort: str | None = None, - q: str | None = None, - include_totals: bool = True, - fields: list[str] | None = None, - from_param: str | None = None, - take: int | None = None, - include_fields: bool = True, - ) -> dict[str, Incomplete]: ... - def get(self, id: str) -> dict[str, Incomplete]: ... - async def get_async(self, id: str) -> dict[str, Incomplete]: ... diff --git a/stubs/auth0-python/auth0/management/organizations.pyi b/stubs/auth0-python/auth0/management/organizations.pyi deleted file mode 100644 index 9dc1205b3e43..000000000000 --- a/stubs/auth0-python/auth0/management/organizations.pyi +++ /dev/null @@ -1,134 +0,0 @@ -from _typeshed import Incomplete - -from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions -from ..types import TimeoutType as TimeoutType - -class Organizations: - domain: Incomplete - protocol: Incomplete - client: Incomplete - def __init__( - self, - domain: str, - token: str, - telemetry: bool = True, - timeout: TimeoutType = 5.0, - protocol: str = "https", - rest_options: RestClientOptions | None = None, - ) -> None: ... - def all_organizations( - self, - page: int | None = None, - per_page: int | None = None, - include_totals: bool = True, - from_param: str | None = None, - take: int | None = None, - ) -> dict[str, Incomplete]: ... - async def all_organizations_async( - self, - page: int | None = None, - per_page: int | None = None, - include_totals: bool = True, - from_param: str | None = None, - take: int | None = None, - ) -> dict[str, Incomplete]: ... - def get_organization_by_name(self, name: str | None = None) -> dict[str, Incomplete]: ... - async def get_organization_by_name_async(self, name: str | None = None) -> dict[str, Incomplete]: ... - def get_organization(self, id: str) -> dict[str, Incomplete]: ... - async def get_organization_async(self, id: str) -> dict[str, Incomplete]: ... - def create_organization(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def create_organization_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - def update_organization(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def update_organization_async(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - def delete_organization(self, id: str): ... - async def delete_organization_async(self, id: str): ... - def all_organization_connections( - self, id: str, page: int | None = None, per_page: int | None = None - ) -> list[dict[str, Incomplete]]: ... - async def all_organization_connections_async( - self, id: str, page: int | None = None, per_page: int | None = None - ) -> list[dict[str, Incomplete]]: ... - def get_organization_connection(self, id: str, connection_id: str) -> dict[str, Incomplete]: ... - async def get_organization_connection_async(self, id: str, connection_id: str) -> dict[str, Incomplete]: ... - def create_organization_connection(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def create_organization_connection_async(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - def update_organization_connection( - self, id: str, connection_id: str, body: dict[str, Incomplete] - ) -> dict[str, Incomplete]: ... - async def update_organization_connection_async( - self, id: str, connection_id: str, body: dict[str, Incomplete] - ) -> dict[str, Incomplete]: ... - def delete_organization_connection(self, id: str, connection_id: str): ... - async def delete_organization_connection_async(self, id: str, connection_id: str): ... - def all_organization_members( - self, - id: str, - page: int | None = None, - per_page: int | None = None, - include_totals: bool = True, - from_param: str | None = None, - take: int | None = None, - fields: list[str] | None = None, - include_fields: bool = True, - ) -> dict[str, Incomplete]: ... - async def all_organization_members_async( - self, - id: str, - page: int | None = None, - per_page: int | None = None, - include_totals: bool = True, - from_param: str | None = None, - take: int | None = None, - fields: list[str] | None = None, - include_fields: bool = True, - ) -> dict[str, Incomplete]: ... - def create_organization_members(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def create_organization_members_async(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - def delete_organization_members(self, id: str, body: dict[str, Incomplete]): ... - async def delete_organization_members_async(self, id: str, body: dict[str, Incomplete]): ... - def all_organization_member_roles( - self, id: str, user_id: str, page: int | None = None, per_page: int | None = None, include_totals: bool = False - ) -> list[dict[str, Incomplete]]: ... - async def all_organization_member_roles_async( - self, id: str, user_id: str, page: int | None = None, per_page: int | None = None, include_totals: bool = False - ) -> list[dict[str, Incomplete]]: ... - def create_organization_member_roles(self, id: str, user_id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def create_organization_member_roles_async( - self, id: str, user_id: str, body: dict[str, Incomplete] - ) -> dict[str, Incomplete]: ... - def delete_organization_member_roles(self, id: str, user_id: str, body: dict[str, Incomplete]): ... - async def delete_organization_member_roles_async(self, id: str, user_id: str, body: dict[str, Incomplete]): ... - def all_organization_invitations( - self, id: str, page: int | None = None, per_page: int | None = None, include_totals: bool = False - ) -> dict[str, Incomplete]: ... - async def all_organization_invitations_async( - self, id: str, page: int | None = None, per_page: int | None = None, include_totals: bool = False - ) -> dict[str, Incomplete]: ... - def get_organization_invitation(self, id: str, invitaton_id: str) -> dict[str, Incomplete]: ... - async def get_organization_invitation_async(self, id: str, invitaton_id: str) -> dict[str, Incomplete]: ... - def create_organization_invitation(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def create_organization_invitation_async(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - def delete_organization_invitation(self, id: str, invitation_id: str): ... - async def delete_organization_invitation_async(self, id: str, invitation_id: str): ... - def get_client_grants( - self, - id: str, - audience: str | None = None, - client_id: str | None = None, - page: int | None = None, - per_page: int | None = None, - include_totals: bool = False, - ) -> dict[str, Incomplete]: ... - async def get_client_grants_async( - self, - id: str, - audience: str | None = None, - client_id: str | None = None, - page: int | None = None, - per_page: int | None = None, - include_totals: bool = False, - ) -> dict[str, Incomplete]: ... - def add_client_grant(self, id: str, grant_id: str) -> dict[str, Incomplete]: ... - async def add_client_grant_async(self, id: str, grant_id: str) -> dict[str, Incomplete]: ... - def delete_client_grant(self, id: str, grant_id: str) -> dict[str, Incomplete]: ... - async def delete_client_grant_async(self, id: str, grant_id: str) -> dict[str, Incomplete]: ... diff --git a/stubs/auth0-python/auth0/management/prompts.pyi b/stubs/auth0-python/auth0/management/prompts.pyi deleted file mode 100644 index 37376d758e3c..000000000000 --- a/stubs/auth0-python/auth0/management/prompts.pyi +++ /dev/null @@ -1,28 +0,0 @@ -from _typeshed import Incomplete - -from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions -from ..types import TimeoutType as TimeoutType - -class Prompts: - domain: Incomplete - protocol: Incomplete - client: Incomplete - def __init__( - self, - domain: str, - token: str, - telemetry: bool = True, - timeout: TimeoutType = 5.0, - protocol: str = "https", - rest_options: RestClientOptions | None = None, - ) -> None: ... - def get(self) -> dict[str, Incomplete]: ... - async def get_async(self) -> dict[str, Incomplete]: ... - def update(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def update_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - def get_custom_text(self, prompt: str, language: str): ... - async def get_custom_text_async(self, prompt: str, language: str): ... - def update_custom_text(self, prompt: str, language: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def update_custom_text_async( - self, prompt: str, language: str, body: dict[str, Incomplete] - ) -> dict[str, Incomplete]: ... diff --git a/stubs/auth0-python/auth0/management/resource_servers.pyi b/stubs/auth0-python/auth0/management/resource_servers.pyi deleted file mode 100644 index 8e6ca07b0b9d..000000000000 --- a/stubs/auth0-python/auth0/management/resource_servers.pyi +++ /dev/null @@ -1,28 +0,0 @@ -from _typeshed import Incomplete - -from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions -from ..types import TimeoutType as TimeoutType - -class ResourceServers: - domain: Incomplete - protocol: Incomplete - client: Incomplete - def __init__( - self, - domain: str, - token: str, - telemetry: bool = True, - timeout: TimeoutType = 5.0, - protocol: str = "https", - rest_options: RestClientOptions | None = None, - ) -> None: ... - def create(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def create_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - def get_all(self, page: int | None = None, per_page: int | None = None, include_totals: bool = False): ... - async def get_all_async(self, page: int | None = None, per_page: int | None = None, include_totals: bool = False): ... - def get(self, id: str) -> dict[str, Incomplete]: ... - async def get_async(self, id: str) -> dict[str, Incomplete]: ... - def delete(self, id: str): ... - async def delete_async(self, id: str): ... - def update(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def update_async(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... diff --git a/stubs/auth0-python/auth0/management/roles.pyi b/stubs/auth0-python/auth0/management/roles.pyi deleted file mode 100644 index 1cb8b1ff9b34..000000000000 --- a/stubs/auth0-python/auth0/management/roles.pyi +++ /dev/null @@ -1,63 +0,0 @@ -from _typeshed import Incomplete -from builtins import list as _list - -from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions -from ..types import TimeoutType as TimeoutType - -class Roles: - domain: Incomplete - protocol: Incomplete - client: Incomplete - def __init__( - self, - domain: str, - token: str, - telemetry: bool = True, - timeout: TimeoutType = 5.0, - protocol: str = "https", - rest_options: RestClientOptions | None = None, - ) -> None: ... - def list( - self, page: int = 0, per_page: int = 25, include_totals: bool = True, name_filter: str | None = None - ) -> dict[str, Incomplete]: ... - async def list_async( - self, page: int = 0, per_page: int = 25, include_totals: bool = True, name_filter: str | None = None - ) -> dict[str, Incomplete]: ... - def create(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def create_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - def get(self, id: str) -> dict[str, Incomplete]: ... - async def get_async(self, id: str) -> dict[str, Incomplete]: ... - def delete(self, id: str): ... - async def delete_async(self, id: str): ... - def update(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def update_async(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - def list_users( - self, - id: str, - page: int = 0, - per_page: int = 25, - include_totals: bool = True, - from_param: str | None = None, - take: int | None = None, - ) -> dict[str, Incomplete]: ... - async def list_users_async( - self, - id: str, - page: int = 0, - per_page: int = 25, - include_totals: bool = True, - from_param: str | None = None, - take: int | None = None, - ) -> dict[str, Incomplete]: ... - def add_users(self, id: str, users: _list[str]) -> dict[str, Incomplete]: ... - async def add_users_async(self, id: str, users: _list[str]) -> dict[str, Incomplete]: ... - def list_permissions( - self, id: str, page: int = 0, per_page: int = 25, include_totals: bool = True - ) -> dict[str, Incomplete]: ... - async def list_permissions_async( - self, id: str, page: int = 0, per_page: int = 25, include_totals: bool = True - ) -> dict[str, Incomplete]: ... - def remove_permissions(self, id: str, permissions: _list[dict[str, str]]): ... - async def remove_permissions_async(self, id: str, permissions: _list[dict[str, str]]): ... - def add_permissions(self, id: str, permissions: _list[dict[str, str]]) -> dict[str, Incomplete]: ... - async def add_permissions_async(self, id: str, permissions: _list[dict[str, str]]) -> dict[str, Incomplete]: ... diff --git a/stubs/auth0-python/auth0/management/rules.pyi b/stubs/auth0-python/auth0/management/rules.pyi deleted file mode 100644 index 1eac99eb60f7..000000000000 --- a/stubs/auth0-python/auth0/management/rules.pyi +++ /dev/null @@ -1,46 +0,0 @@ -from _typeshed import Incomplete - -from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions -from ..types import TimeoutType as TimeoutType - -class Rules: - domain: Incomplete - protocol: Incomplete - client: Incomplete - def __init__( - self, - domain: str, - token: str, - telemetry: bool = True, - timeout: TimeoutType = 5.0, - protocol: str = "https", - rest_options: RestClientOptions | None = None, - ) -> None: ... - def all( - self, - stage: str = "login_success", - enabled: bool = True, - fields: list[str] | None = None, - include_fields: bool = True, - page: int | None = None, - per_page: int | None = None, - include_totals: bool = False, - ) -> dict[str, Incomplete]: ... - async def all_async( - self, - stage: str = "login_success", - enabled: bool = True, - fields: list[str] | None = None, - include_fields: bool = True, - page: int | None = None, - per_page: int | None = None, - include_totals: bool = False, - ) -> dict[str, Incomplete]: ... - def create(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def create_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - def get(self, id: str, fields: list[str] | None = None, include_fields: bool = True) -> dict[str, Incomplete]: ... - async def get_async(self, id: str, fields: list[str] | None = None, include_fields: bool = True) -> dict[str, Incomplete]: ... - def delete(self, id: str): ... - async def delete_async(self, id: str): ... - def update(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def update_async(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... diff --git a/stubs/auth0-python/auth0/management/rules_configs.pyi b/stubs/auth0-python/auth0/management/rules_configs.pyi deleted file mode 100644 index f276a18d9a36..000000000000 --- a/stubs/auth0-python/auth0/management/rules_configs.pyi +++ /dev/null @@ -1,24 +0,0 @@ -from _typeshed import Incomplete - -from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions -from ..types import TimeoutType as TimeoutType - -class RulesConfigs: - domain: Incomplete - protocol: Incomplete - client: Incomplete - def __init__( - self, - domain: str, - token: str, - telemetry: bool = True, - timeout: TimeoutType = 5.0, - protocol: str = "https", - rest_options: RestClientOptions | None = None, - ) -> None: ... - def all(self) -> list[dict[str, Incomplete]]: ... - async def all_async(self) -> list[dict[str, Incomplete]]: ... - def unset(self, key: str): ... - async def unset_async(self, key: str): ... - def set(self, key: str, value: str) -> dict[str, Incomplete]: ... - async def set_async(self, key: str, value: str) -> dict[str, Incomplete]: ... diff --git a/stubs/auth0-python/auth0/management/stats.pyi b/stubs/auth0-python/auth0/management/stats.pyi deleted file mode 100644 index f3128be12eaf..000000000000 --- a/stubs/auth0-python/auth0/management/stats.pyi +++ /dev/null @@ -1,24 +0,0 @@ -from _typeshed import Incomplete - -from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions -from ..types import TimeoutType as TimeoutType - -class Stats: - domain: Incomplete - protocol: Incomplete - client: Incomplete - def __init__( - self, - domain: str, - token: str, - telemetry: bool = True, - timeout: TimeoutType = 5.0, - protocol: str = "https", - rest_options: RestClientOptions | None = None, - ) -> None: ... - def active_users(self) -> int: ... - async def active_users_async(self) -> int: ... - def daily_stats(self, from_date: str | None = None, to_date: str | None = None) -> list[dict[str, Incomplete]]: ... - async def daily_stats_async( - self, from_date: str | None = None, to_date: str | None = None - ) -> list[dict[str, Incomplete]]: ... diff --git a/stubs/auth0-python/auth0/management/tenants.pyi b/stubs/auth0-python/auth0/management/tenants.pyi deleted file mode 100644 index 12a4df7ad40a..000000000000 --- a/stubs/auth0-python/auth0/management/tenants.pyi +++ /dev/null @@ -1,22 +0,0 @@ -from _typeshed import Incomplete - -from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions -from ..types import TimeoutType as TimeoutType - -class Tenants: - domain: Incomplete - protocol: Incomplete - client: Incomplete - def __init__( - self, - domain: str, - token: str, - telemetry: bool = True, - timeout: TimeoutType = 5.0, - protocol: str = "https", - rest_options: RestClientOptions | None = None, - ) -> None: ... - def get(self, fields: list[str] | None = None, include_fields: bool = True) -> dict[str, Incomplete]: ... - async def get_async(self, fields: list[str] | None = None, include_fields: bool = True) -> dict[str, Incomplete]: ... - def update(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def update_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... diff --git a/stubs/auth0-python/auth0/management/tickets.pyi b/stubs/auth0-python/auth0/management/tickets.pyi deleted file mode 100644 index 236596687f29..000000000000 --- a/stubs/auth0-python/auth0/management/tickets.pyi +++ /dev/null @@ -1,22 +0,0 @@ -from _typeshed import Incomplete - -from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions -from ..types import TimeoutType as TimeoutType - -class Tickets: - domain: Incomplete - protocol: Incomplete - client: Incomplete - def __init__( - self, - domain: str, - token: str, - telemetry: bool = True, - timeout: TimeoutType = 5.0, - protocol: str = "https", - rest_options: RestClientOptions | None = None, - ) -> None: ... - def create_email_verification(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def create_email_verification_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - def create_pswd_change(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def create_pswd_change_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... diff --git a/stubs/auth0-python/auth0/management/user_blocks.pyi b/stubs/auth0-python/auth0/management/user_blocks.pyi deleted file mode 100644 index 7417dd514e59..000000000000 --- a/stubs/auth0-python/auth0/management/user_blocks.pyi +++ /dev/null @@ -1,26 +0,0 @@ -from _typeshed import Incomplete - -from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions -from ..types import TimeoutType as TimeoutType - -class UserBlocks: - domain: Incomplete - protocol: Incomplete - client: Incomplete - def __init__( - self, - domain: str, - token: str, - telemetry: bool = True, - timeout: TimeoutType = 5.0, - protocol: str = "https", - rest_options: RestClientOptions | None = None, - ) -> None: ... - def get_by_identifier(self, identifier: str) -> dict[str, Incomplete]: ... - async def get_by_identifier_async(self, identifier: str) -> dict[str, Incomplete]: ... - def unblock_by_identifier(self, identifier: dict[str, Incomplete]): ... - async def unblock_by_identifier_async(self, identifier: dict[str, Incomplete]): ... - def get(self, id: str) -> dict[str, Incomplete]: ... - async def get_async(self, id: str) -> dict[str, Incomplete]: ... - def unblock(self, id: str): ... - async def unblock_async(self, id: str): ... diff --git a/stubs/auth0-python/auth0/management/users.pyi b/stubs/auth0-python/auth0/management/users.pyi deleted file mode 100644 index 6ba1283d69cf..000000000000 --- a/stubs/auth0-python/auth0/management/users.pyi +++ /dev/null @@ -1,117 +0,0 @@ -from _typeshed import Incomplete -from builtins import list as _list - -from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions -from ..types import TimeoutType as TimeoutType - -class Users: - domain: Incomplete - protocol: Incomplete - client: Incomplete - def __init__( - self, - domain: str, - token: str, - telemetry: bool = True, - timeout: TimeoutType = 5.0, - protocol: str = "https", - rest_options: RestClientOptions | None = None, - ) -> None: ... - def list( - self, - page: int = 0, - per_page: int = 25, - sort: str | None = None, - connection: str | None = None, - q: str | None = None, - search_engine: str | None = None, - include_totals: bool = True, - fields: _list[str] | None = None, - include_fields: bool = True, - ) -> dict[str, Incomplete]: ... - async def list_async( - self, - page: int = 0, - per_page: int = 25, - sort: str | None = None, - connection: str | None = None, - q: str | None = None, - search_engine: str | None = None, - include_totals: bool = True, - fields: _list[str] | None = None, - include_fields: bool = True, - ) -> dict[str, Incomplete]: ... - def create(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def create_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - def get(self, id: str, fields: _list[str] | None = None, include_fields: bool = True) -> dict[str, Incomplete]: ... - async def get_async( - self, id: str, fields: _list[str] | None = None, include_fields: bool = True - ) -> dict[str, Incomplete]: ... - def delete(self, id: str): ... - async def delete_async(self, id: str): ... - def update(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def update_async(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - def list_organizations( - self, id: str, page: int = 0, per_page: int = 25, include_totals: bool = True - ) -> dict[str, Incomplete]: ... - async def list_organizations_async( - self, id: str, page: int = 0, per_page: int = 25, include_totals: bool = True - ) -> dict[str, Incomplete]: ... - def list_roles(self, id: str, page: int = 0, per_page: int = 25, include_totals: bool = True) -> dict[str, Incomplete]: ... - async def list_roles_async( - self, id: str, page: int = 0, per_page: int = 25, include_totals: bool = True - ) -> dict[str, Incomplete]: ... - def remove_roles(self, id: str, roles: _list[str]): ... - async def remove_roles_async(self, id: str, roles: _list[str]): ... - def add_roles(self, id: str, roles: _list[str]) -> dict[str, Incomplete]: ... - async def add_roles_async(self, id: str, roles: _list[str]) -> dict[str, Incomplete]: ... - def list_permissions( - self, id: str, page: int = 0, per_page: int = 25, include_totals: bool = True - ) -> dict[str, Incomplete]: ... - async def list_permissions_async( - self, id: str, page: int = 0, per_page: int = 25, include_totals: bool = True - ) -> dict[str, Incomplete]: ... - def remove_permissions(self, id: str, permissions: _list[str]): ... - async def remove_permissions_async(self, id: str, permissions: _list[str]): ... - def add_permissions(self, id: str, permissions: _list[str]) -> dict[str, Incomplete]: ... - async def add_permissions_async(self, id: str, permissions: _list[str]) -> dict[str, Incomplete]: ... - def delete_multifactor(self, id: str, provider: str): ... - async def delete_multifactor_async(self, id: str, provider: str): ... - def delete_authenticators(self, id: str): ... - async def delete_authenticators_async(self, id: str): ... - def unlink_user_account(self, id: str, provider: str, user_id: str): ... - async def unlink_user_account_async(self, id: str, provider: str, user_id: str): ... - def link_user_account(self, user_id: str, body: dict[str, Incomplete]) -> _list[dict[str, Incomplete]]: ... - async def link_user_account_async(self, user_id: str, body: dict[str, Incomplete]) -> _list[dict[str, Incomplete]]: ... - def regenerate_recovery_code(self, user_id: str) -> dict[str, Incomplete]: ... - async def regenerate_recovery_code_async(self, user_id: str) -> dict[str, Incomplete]: ... - def get_guardian_enrollments(self, user_id: str) -> dict[str, Incomplete]: ... - async def get_guardian_enrollments_async(self, user_id: str) -> dict[str, Incomplete]: ... - def get_log_events( - self, user_id: str, page: int = 0, per_page: int = 50, sort: str | None = None, include_totals: bool = False - ) -> dict[str, Incomplete]: ... - async def get_log_events_async( - self, user_id: str, page: int = 0, per_page: int = 50, sort: str | None = None, include_totals: bool = False - ) -> dict[str, Incomplete]: ... - def invalidate_remembered_browsers(self, user_id: str) -> dict[str, Incomplete]: ... - async def invalidate_remembered_browsers_async(self, user_id: str) -> dict[str, Incomplete]: ... - def get_authentication_methods(self, user_id: str) -> dict[str, Incomplete]: ... - async def get_authentication_methods_async(self, user_id: str) -> dict[str, Incomplete]: ... - def get_authentication_method_by_id(self, user_id: str, authentication_method_id: str) -> dict[str, Incomplete]: ... - async def get_authentication_method_by_id_async( - self, user_id: str, authentication_method_id: str - ) -> dict[str, Incomplete]: ... - def create_authentication_method(self, user_id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def create_authentication_method_async(self, user_id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - def update_authentication_methods(self, user_id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - async def update_authentication_methods_async(self, user_id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... - def update_authentication_method_by_id( - self, user_id: str, authentication_method_id: str, body: dict[str, Incomplete] - ) -> dict[str, Incomplete]: ... - async def update_authentication_method_by_id_async( - self, user_id: str, authentication_method_id: str, body: dict[str, Incomplete] - ) -> dict[str, Incomplete]: ... - def delete_authentication_methods(self, user_id: str): ... - async def delete_authentication_methods_async(self, user_id: str): ... - def delete_authentication_method_by_id(self, user_id: str, authentication_method_id: str): ... - async def delete_authentication_method_by_id_async(self, user_id: str, authentication_method_id: str): ... diff --git a/stubs/auth0-python/auth0/management/users_by_email.pyi b/stubs/auth0-python/auth0/management/users_by_email.pyi deleted file mode 100644 index 177fe7b092bf..000000000000 --- a/stubs/auth0-python/auth0/management/users_by_email.pyi +++ /dev/null @@ -1,24 +0,0 @@ -from _typeshed import Incomplete - -from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions -from ..types import TimeoutType as TimeoutType - -class UsersByEmail: - domain: Incomplete - protocol: Incomplete - client: Incomplete - def __init__( - self, - domain: str, - token: str, - telemetry: bool = True, - timeout: TimeoutType = 5.0, - protocol: str = "https", - rest_options: RestClientOptions | None = None, - ) -> None: ... - def search_users_by_email( - self, email: str, fields: list[str] | None = None, include_fields: bool = True - ) -> list[dict[str, Incomplete]]: ... - async def search_users_by_email_async( - self, email: str, fields: list[str] | None = None, include_fields: bool = True - ) -> list[dict[str, Incomplete]]: ... diff --git a/stubs/auth0-python/auth0/rest.pyi b/stubs/auth0-python/auth0/rest.pyi deleted file mode 100644 index 131dd1d75fa1..000000000000 --- a/stubs/auth0-python/auth0/rest.pyi +++ /dev/null @@ -1,48 +0,0 @@ -from _typeshed import Incomplete -from collections.abc import Mapping - -import requests -from auth0.exceptions import Auth0Error as Auth0Error, RateLimitError as RateLimitError -from auth0.rest_async import RequestsResponse as RequestsResponse -from auth0.types import RequestData as RequestData, TimeoutType as TimeoutType - -UNKNOWN_ERROR: str - -class RestClientOptions: - telemetry: Incomplete - timeout: Incomplete - retries: Incomplete - def __init__(self, telemetry: bool = True, timeout: TimeoutType = 5.0, retries: int = 3) -> None: ... - -class RestClient: - options: Incomplete - jwt: Incomplete - base_headers: Incomplete - telemetry: Incomplete - timeout: Incomplete - def __init__( - self, jwt: str | None, telemetry: bool = True, timeout: TimeoutType = 5.0, options: RestClientOptions | None = None - ) -> None: ... - def MAX_REQUEST_RETRIES(self) -> int: ... - def MAX_REQUEST_RETRY_JITTER(self) -> int: ... - def MAX_REQUEST_RETRY_DELAY(self) -> int: ... - def MIN_REQUEST_RETRY_DELAY(self) -> int: ... - def get(self, url: str, params: dict[str, Incomplete] | None = None, headers: dict[str, str] | None = None): ... - def post(self, url: str, data: RequestData | None = None, headers: dict[str, str] | None = None): ... - def file_post(self, url: str, data: RequestData | None = None, files: dict[str, Incomplete] | None = None): ... - def patch(self, url: str, data: RequestData | None = None): ... - def put(self, url: str, data: RequestData | None = None): ... - def delete(self, url: str, params: dict[str, Incomplete] | None = None, data: RequestData | None = None): ... - -class Response: - def __init__(self, status_code: int, content, headers: Mapping[str, str]) -> None: ... - def content(self): ... - -class JsonResponse(Response): - def __init__(self, response: requests.Response | RequestsResponse) -> None: ... - -class PlainResponse(Response): - def __init__(self, response: requests.Response | RequestsResponse) -> None: ... - -class EmptyResponse(Response): - def __init__(self, status_code: int) -> None: ... diff --git a/stubs/auth0-python/auth0/rest_async.pyi b/stubs/auth0-python/auth0/rest_async.pyi deleted file mode 100644 index 7bc59c471611..000000000000 --- a/stubs/auth0-python/auth0/rest_async.pyi +++ /dev/null @@ -1,29 +0,0 @@ -from _typeshed import Incomplete - -from auth0.exceptions import RateLimitError as RateLimitError -from auth0.types import RequestData as RequestData - -from .rest import ( - EmptyResponse as EmptyResponse, - JsonResponse as JsonResponse, - PlainResponse as PlainResponse, - Response as Response, - RestClient as RestClient, -) - -class AsyncRestClient(RestClient): - timeout: Incomplete - def __init__(self, *args, **kwargs) -> None: ... - def set_session(self, session) -> None: ... - async def get(self, url: str, params: dict[str, Incomplete] | None = None, headers: dict[str, str] | None = None): ... - async def post(self, url: str, data: RequestData | None = None, headers: dict[str, str] | None = None): ... - async def file_post(self, *args, **kwargs): ... - async def patch(self, url: str, data: RequestData | None = None): ... - async def put(self, url: str, data: RequestData | None = None): ... - async def delete(self, url: str, params: dict[str, Incomplete] | None = None, data: RequestData | None = None): ... - -class RequestsResponse: - status_code: Incomplete - headers: Incomplete - text: Incomplete - def __init__(self, response, text: str) -> None: ... diff --git a/stubs/auth0-python/auth0/types.pyi b/stubs/auth0-python/auth0/types.pyi deleted file mode 100644 index 385643dc72d0..000000000000 --- a/stubs/auth0-python/auth0/types.pyi +++ /dev/null @@ -1,5 +0,0 @@ -from _typeshed import Incomplete -from typing_extensions import TypeAlias - -TimeoutType: TypeAlias = float | tuple[float, float] -RequestData: TypeAlias = dict[str, Incomplete] | list[Incomplete] diff --git a/stubs/auth0-python/auth0/utils.pyi b/stubs/auth0-python/auth0/utils.pyi deleted file mode 100644 index 611cd037c258..000000000000 --- a/stubs/auth0-python/auth0/utils.pyi +++ /dev/null @@ -1 +0,0 @@ -def is_async_available() -> bool: ... From 072b5ac73eafe784bb708c192789be69d15a6fac Mon Sep 17 00:00:00 2001 From: Avasam Date: Sat, 12 Apr 2025 12:26:03 -0400 Subject: [PATCH 02/12] dedent and auto not include already async --- scripts/sync_auth0_python.py | 37 ++++++++++++------- stubs/auth0-python/METADATA.toml | 7 +++- .../authentication/token_verifier.pyi | 29 --------------- 3 files changed, 30 insertions(+), 43 deletions(-) delete mode 100644 stubs/auth0-python/auth0/_asyncified/authentication/token_verifier.pyi diff --git a/scripts/sync_auth0_python.py b/scripts/sync_auth0_python.py index dd1d8a366fdc..9577beb5410f 100644 --- a/scripts/sync_auth0_python.py +++ b/scripts/sync_auth0_python.py @@ -1,8 +1,10 @@ import re import shutil import sys +from itertools import chain from pathlib import Path from subprocess import check_call, run +from textwrap import dedent _ASYNCIFIED_PATH = Path("stubs/auth0-python/auth0/_asyncified") KEEP_LINES_STARTSWITH = ("from ", "import ", " def ", "class ", "\n") @@ -15,11 +17,16 @@ def main() -> None: # Move the generated stubs to the right place shutil.copytree(_ASYNCIFIED_PATH / "auth0", _ASYNCIFIED_PATH, copy_function=shutil.move, dirs_exist_ok=True) shutil.rmtree(_ASYNCIFIED_PATH / "auth0") + for path_to_remove in ( (_ASYNCIFIED_PATH / "authentication" / "__init__.pyi"), (_ASYNCIFIED_PATH / "management" / "__init__.pyi"), - # These manage async in their own way - *_ASYNCIFIED_PATH.rglob("async_*.pyi"), + *chain.from_iterable( + [ + (already_async, already_async.with_name(already_async.name.removeprefix("async_"))) + for already_async in _ASYNCIFIED_PATH.rglob("async_*.pyi") + ] + ), ): path_to_remove.unlink() @@ -27,6 +34,7 @@ def main() -> None: for stub_path in _ASYNCIFIED_PATH.rglob("*.pyi"): with stub_path.open() as stub_file: lines = stub_file.readlines() + relative_module = (stub_path.relative_to(_ASYNCIFIED_PATH).with_suffix("").as_posix()).replace("/", ".") # Only keep imports, classes and public non-special methods stub_content = "".join( @@ -45,24 +53,27 @@ def main() -> None: stub_content = re.sub(r"(from \.\w+? import )(\w+?)\n", "\\1_\\2Async\n", stub_content) # Prep extra imports stub_content = "from typing import type_check_only\n" + stub_content + # Rename classes to their stub-only asyncified variant and subclass them - relative_module = (stub_path.relative_to(_ASYNCIFIED_PATH).with_suffix("").as_posix()).replace("/", ".") - # Transform subclasses. These are a bit weird since they may have asyncified methods hidden by base class. - # We must also update their imports + # Transform subclasses. These are a bit odd since they may have asyncified methods hidden by base class. stub_content = re.sub( r"class (\w+?)\((\w+?)\):", - """\ -@type_check_only -class _\\1Async(_\\2Async):""", + dedent( + """\ + @type_check_only + class _\\1Async(_\\2Async):""" + ), stub_content, ) - # Transform base classes + # Transform base classes stub_content = re.sub( r"class (\w+?):", - f"""\ -from auth0.{relative_module} import \\1 # noqa: E402 -@type_check_only -class _\\1Async(\\1):""", + dedent( + f"""\ + from auth0.{relative_module} import \\1 # noqa: E402 + @type_check_only + class _\\1Async(\\1):""" + ), stub_content, ) # Update methods to their asyncified variant diff --git a/stubs/auth0-python/METADATA.toml b/stubs/auth0-python/METADATA.toml index 18b052c73ac6..79ebf773d535 100644 --- a/stubs/auth0-python/METADATA.toml +++ b/stubs/auth0-python/METADATA.toml @@ -1,5 +1,10 @@ version = "4.8.*" upstream_repository = "https://github.com/auth0/auth0-python" -requires = ["cryptography", "types-requests"] +requires = ["aiohttp", "auth0-python", "cryptography"] # Inline typing of the library is complete, but it's missing dynamically generated _async methods and subclasses, which we generate partial_stub = true + +# When ran directly on our stubs, mypy won't understand that they are partial +[mypy-tests.auth0] +module_name = "auth0.*" +values = { "follow_untyped_imports" = true } diff --git a/stubs/auth0-python/auth0/_asyncified/authentication/token_verifier.pyi b/stubs/auth0-python/auth0/_asyncified/authentication/token_verifier.pyi deleted file mode 100644 index e776ff1c8bb1..000000000000 --- a/stubs/auth0-python/auth0/_asyncified/authentication/token_verifier.pyi +++ /dev/null @@ -1,29 +0,0 @@ -# AUTOGENERATED BY scripts/sync_auth0_python.py -from typing import Any, type_check_only - -from auth0.authentication.token_verifier import SignatureVerifier -from cryptography.hazmat.primitives.asymmetric.rsa import RSAPublicKey - -@type_check_only -class _SignatureVerifierAsync(SignatureVerifier): - async def verify_signature_async(self, token: str) -> dict[str, Any]: ... - -@type_check_only -class _SymmetricSignatureVerifierAsync(_SignatureVerifierAsync): ... - -from auth0.authentication.token_verifier import JwksFetcher # noqa: E402 - -@type_check_only -class _JwksFetcherAsync(JwksFetcher): - async def get_key_async(self, key_id: str) -> RSAPublicKey: ... - -@type_check_only -class _AsymmetricSignatureVerifierAsync(_SignatureVerifierAsync): ... - -from auth0.authentication.token_verifier import TokenVerifier # noqa: E402 - -@type_check_only -class _TokenVerifierAsync(TokenVerifier): - async def verify_async( - self, token: str, nonce: str | None = None, max_age: int | None = None, organization: str | None = None - ) -> dict[str, Any]: ... From cc1a797b24760ae65643277762941533454eb4e6 Mon Sep 17 00:00:00 2001 From: Avasam Date: Sun, 13 Apr 2025 20:20:08 -0400 Subject: [PATCH 03/12] Finished autogeneration --- .flake8 | 1 + scripts/sync_auth0_python.py | 67 +++++- stubs/auth0-python/auth0/asyncify.pyi | 195 +++++++++++++++++- .../auth0/management/async_auth0.pyi | 2 +- 4 files changed, 257 insertions(+), 8 deletions(-) diff --git a/.flake8 b/.flake8 index 3b99b881864f..eed94143c742 100644 --- a/.flake8 +++ b/.flake8 @@ -11,5 +11,6 @@ per-file-ignores = # Y026: Have implicit type aliases # Y053: have literals >50 characters long stubs/*_pb2.pyi: Y021, Y023, Y026, Y053 + stubs/auth0-python/auth0/_asyncified/**/*.pyi: Y053 exclude = .venv*,.git diff --git a/scripts/sync_auth0_python.py b/scripts/sync_auth0_python.py index 9577beb5410f..438c9a6ff3c1 100644 --- a/scripts/sync_auth0_python.py +++ b/scripts/sync_auth0_python.py @@ -1,6 +1,7 @@ import re import shutil import sys +from collections.abc import Iterable from itertools import chain from pathlib import Path from subprocess import check_call, run @@ -9,9 +10,11 @@ _ASYNCIFIED_PATH = Path("stubs/auth0-python/auth0/_asyncified") KEEP_LINES_STARTSWITH = ("from ", "import ", " def ", "class ", "\n") +BASE_CLASS_RE = re.compile(r"class (\w+?):") +SUBCLASS_RE = re.compile(r"class (\w+?)\((\w+?)\):") -def main() -> None: - # Generate the stubs + +def generate_stubs() -> None: check_call(("stubgen", "-p", "auth0.authentication", "-p", "auth0.management", "-o", _ASYNCIFIED_PATH)) # Move the generated stubs to the right place @@ -30,6 +33,11 @@ def main() -> None: ): path_to_remove.unlink() + +def modify_stubs() -> list[tuple[str, str]]: + base_classes_for_overload: list[tuple[str, str]] = [] + subclasses_for_overload: list[tuple[str, str]] = [] + # Cleanup and modify the stubs for stub_path in _ASYNCIFIED_PATH.rglob("*.pyi"): with stub_path.open() as stub_file: @@ -45,6 +53,9 @@ def main() -> None: ] ) + base_classes_for_overload.extend([(relative_module, match) for match in re.findall(BASE_CLASS_RE, stub_content)]) + subclasses_for_overload.extend([(relative_module, groups[0]) for groups in re.findall(SUBCLASS_RE, stub_content)]) + # Remove redundant ` as ` imports stub_content = re.sub(r"(.+?) as \1", "\\1", stub_content) # Fix relative imports @@ -57,7 +68,7 @@ def main() -> None: # Rename classes to their stub-only asyncified variant and subclass them # Transform subclasses. These are a bit odd since they may have asyncified methods hidden by base class. stub_content = re.sub( - r"class (\w+?)\((\w+?)\):", + SUBCLASS_RE, dedent( """\ @type_check_only @@ -67,7 +78,7 @@ class _\\1Async(_\\2Async):""" ) # Transform base classes stub_content = re.sub( - r"class (\w+?):", + BASE_CLASS_RE, dedent( f"""\ from auth0.{relative_module} import \\1 # noqa: E402 @@ -83,7 +94,53 @@ class _\\1Async(\\1):""" stub_path.write_text("# AUTOGENERATED BY scripts/sync_auth0_python.py\n" + stub_content) - run((sys.executable, "-m", "pre_commit", "run", "--files", *_ASYNCIFIED_PATH.rglob("*.pyi")), check=False) + # Broader types last + return subclasses_for_overload + base_classes_for_overload + + +def generate_asyncify_pyi(classes_for_overload: Iterable[tuple[str, str]]) -> None: + imports = "" + overloads = "" + for relative_module, class_name in classes_for_overload: + deduped_class_name = relative_module.replace(".", "_") + class_name + async_class_name = f"_{class_name}Async" + deduped_async_class_name = relative_module.replace(".", "_") + async_class_name + imports += f"from auth0.{relative_module} import {class_name} as {deduped_class_name}\n" + imports += f"from ._asyncified.{relative_module} import {async_class_name} as {deduped_async_class_name}\n" + overloads += f"@overload\ndef asyncify(cls: type[{deduped_class_name}]) -> type[{deduped_async_class_name}]: ...\n" + + (_ASYNCIFIED_PATH.parent / "asyncify.pyi").write_text( + f"""\ +# AUTOGENERATED BY scripts/sync_auth0_python.py +from typing import overload, TypeVar + +{imports} +_T = TypeVar("_T") + +{overloads} +@overload +def asyncify(cls: type[_T]) -> type[_T]: ... +""" + ) + + +def main() -> None: + generate_stubs() + classes_for_overload = modify_stubs() + generate_asyncify_pyi(classes_for_overload) + + run( + ( + sys.executable, + "-m", + "pre_commit", + "run", + "--files", + *_ASYNCIFIED_PATH.rglob("*.pyi"), + _ASYNCIFIED_PATH.parent / "asyncify.pyi", + ), + check=False, + ) if __name__ == "__main__": diff --git a/stubs/auth0-python/auth0/asyncify.pyi b/stubs/auth0-python/auth0/asyncify.pyi index 7d75cfe631d5..e268b5ec1433 100644 --- a/stubs/auth0-python/auth0/asyncify.pyi +++ b/stubs/auth0-python/auth0/asyncify.pyi @@ -1,2 +1,193 @@ -# TODO: Generate mega overload here -def asyncify(cls: type) -> type: ... +# AUTOGENERATED BY scripts/sync_auth0_python.py +from typing import TypeVar, overload + +from auth0.authentication.back_channel_login import BackChannelLogin as authentication_back_channel_loginBackChannelLogin +from auth0.authentication.base import AuthenticationBase as authentication_baseAuthenticationBase +from auth0.authentication.database import Database as authentication_databaseDatabase +from auth0.authentication.delegated import Delegated as authentication_delegatedDelegated +from auth0.authentication.enterprise import Enterprise as authentication_enterpriseEnterprise +from auth0.authentication.get_token import GetToken as authentication_get_tokenGetToken +from auth0.authentication.passwordless import Passwordless as authentication_passwordlessPasswordless +from auth0.authentication.pushed_authorization_requests import ( + PushedAuthorizationRequests as authentication_pushed_authorization_requestsPushedAuthorizationRequests, +) +from auth0.authentication.revoke_token import RevokeToken as authentication_revoke_tokenRevokeToken +from auth0.authentication.social import Social as authentication_socialSocial +from auth0.authentication.users import Users as authentication_usersUsers +from auth0.management.actions import Actions as management_actionsActions +from auth0.management.attack_protection import AttackProtection as management_attack_protectionAttackProtection +from auth0.management.blacklists import Blacklists as management_blacklistsBlacklists +from auth0.management.branding import Branding as management_brandingBranding +from auth0.management.client_credentials import ClientCredentials as management_client_credentialsClientCredentials +from auth0.management.client_grants import ClientGrants as management_client_grantsClientGrants +from auth0.management.clients import Clients as management_clientsClients +from auth0.management.connections import Connections as management_connectionsConnections +from auth0.management.custom_domains import CustomDomains as management_custom_domainsCustomDomains +from auth0.management.device_credentials import DeviceCredentials as management_device_credentialsDeviceCredentials +from auth0.management.email_templates import EmailTemplates as management_email_templatesEmailTemplates +from auth0.management.emails import Emails as management_emailsEmails +from auth0.management.grants import Grants as management_grantsGrants +from auth0.management.guardian import Guardian as management_guardianGuardian +from auth0.management.hooks import Hooks as management_hooksHooks +from auth0.management.jobs import Jobs as management_jobsJobs +from auth0.management.log_streams import LogStreams as management_log_streamsLogStreams +from auth0.management.logs import Logs as management_logsLogs +from auth0.management.organizations import Organizations as management_organizationsOrganizations +from auth0.management.prompts import Prompts as management_promptsPrompts +from auth0.management.resource_servers import ResourceServers as management_resource_serversResourceServers +from auth0.management.roles import Roles as management_rolesRoles +from auth0.management.rules import Rules as management_rulesRules +from auth0.management.rules_configs import RulesConfigs as management_rules_configsRulesConfigs +from auth0.management.stats import Stats as management_statsStats +from auth0.management.tenants import Tenants as management_tenantsTenants +from auth0.management.tickets import Tickets as management_ticketsTickets +from auth0.management.user_blocks import UserBlocks as management_user_blocksUserBlocks +from auth0.management.users import Users as management_usersUsers +from auth0.management.users_by_email import UsersByEmail as management_users_by_emailUsersByEmail + +from ._asyncified.authentication.back_channel_login import ( + _BackChannelLoginAsync as authentication_back_channel_login_BackChannelLoginAsync, +) +from ._asyncified.authentication.base import _AuthenticationBaseAsync as authentication_base_AuthenticationBaseAsync +from ._asyncified.authentication.database import _DatabaseAsync as authentication_database_DatabaseAsync +from ._asyncified.authentication.delegated import _DelegatedAsync as authentication_delegated_DelegatedAsync +from ._asyncified.authentication.enterprise import _EnterpriseAsync as authentication_enterprise_EnterpriseAsync +from ._asyncified.authentication.get_token import _GetTokenAsync as authentication_get_token_GetTokenAsync +from ._asyncified.authentication.passwordless import _PasswordlessAsync as authentication_passwordless_PasswordlessAsync +from ._asyncified.authentication.pushed_authorization_requests import ( + _PushedAuthorizationRequestsAsync as authentication_pushed_authorization_requests_PushedAuthorizationRequestsAsync, +) +from ._asyncified.authentication.revoke_token import _RevokeTokenAsync as authentication_revoke_token_RevokeTokenAsync +from ._asyncified.authentication.social import _SocialAsync as authentication_social_SocialAsync +from ._asyncified.authentication.users import _UsersAsync as authentication_users_UsersAsync +from ._asyncified.management.actions import _ActionsAsync as management_actions_ActionsAsync +from ._asyncified.management.attack_protection import _AttackProtectionAsync as management_attack_protection_AttackProtectionAsync +from ._asyncified.management.blacklists import _BlacklistsAsync as management_blacklists_BlacklistsAsync +from ._asyncified.management.branding import _BrandingAsync as management_branding_BrandingAsync +from ._asyncified.management.client_credentials import ( + _ClientCredentialsAsync as management_client_credentials_ClientCredentialsAsync, +) +from ._asyncified.management.client_grants import _ClientGrantsAsync as management_client_grants_ClientGrantsAsync +from ._asyncified.management.clients import _ClientsAsync as management_clients_ClientsAsync +from ._asyncified.management.connections import _ConnectionsAsync as management_connections_ConnectionsAsync +from ._asyncified.management.custom_domains import _CustomDomainsAsync as management_custom_domains_CustomDomainsAsync +from ._asyncified.management.device_credentials import ( + _DeviceCredentialsAsync as management_device_credentials_DeviceCredentialsAsync, +) +from ._asyncified.management.email_templates import _EmailTemplatesAsync as management_email_templates_EmailTemplatesAsync +from ._asyncified.management.emails import _EmailsAsync as management_emails_EmailsAsync +from ._asyncified.management.grants import _GrantsAsync as management_grants_GrantsAsync +from ._asyncified.management.guardian import _GuardianAsync as management_guardian_GuardianAsync +from ._asyncified.management.hooks import _HooksAsync as management_hooks_HooksAsync +from ._asyncified.management.jobs import _JobsAsync as management_jobs_JobsAsync +from ._asyncified.management.log_streams import _LogStreamsAsync as management_log_streams_LogStreamsAsync +from ._asyncified.management.logs import _LogsAsync as management_logs_LogsAsync +from ._asyncified.management.organizations import _OrganizationsAsync as management_organizations_OrganizationsAsync +from ._asyncified.management.prompts import _PromptsAsync as management_prompts_PromptsAsync +from ._asyncified.management.resource_servers import _ResourceServersAsync as management_resource_servers_ResourceServersAsync +from ._asyncified.management.roles import _RolesAsync as management_roles_RolesAsync +from ._asyncified.management.rules import _RulesAsync as management_rules_RulesAsync +from ._asyncified.management.rules_configs import _RulesConfigsAsync as management_rules_configs_RulesConfigsAsync +from ._asyncified.management.stats import _StatsAsync as management_stats_StatsAsync +from ._asyncified.management.tenants import _TenantsAsync as management_tenants_TenantsAsync +from ._asyncified.management.tickets import _TicketsAsync as management_tickets_TicketsAsync +from ._asyncified.management.user_blocks import _UserBlocksAsync as management_user_blocks_UserBlocksAsync +from ._asyncified.management.users import _UsersAsync as management_users_UsersAsync +from ._asyncified.management.users_by_email import _UsersByEmailAsync as management_users_by_email_UsersByEmailAsync + +_T = TypeVar("_T") + +@overload +def asyncify( + cls: type[authentication_back_channel_loginBackChannelLogin], +) -> type[authentication_back_channel_login_BackChannelLoginAsync]: ... +@overload +def asyncify(cls: type[authentication_databaseDatabase]) -> type[authentication_database_DatabaseAsync]: ... +@overload +def asyncify(cls: type[authentication_delegatedDelegated]) -> type[authentication_delegated_DelegatedAsync]: ... +@overload +def asyncify(cls: type[authentication_enterpriseEnterprise]) -> type[authentication_enterprise_EnterpriseAsync]: ... +@overload +def asyncify(cls: type[authentication_get_tokenGetToken]) -> type[authentication_get_token_GetTokenAsync]: ... +@overload +def asyncify(cls: type[authentication_passwordlessPasswordless]) -> type[authentication_passwordless_PasswordlessAsync]: ... +@overload +def asyncify( + cls: type[authentication_pushed_authorization_requestsPushedAuthorizationRequests], +) -> type[authentication_pushed_authorization_requests_PushedAuthorizationRequestsAsync]: ... +@overload +def asyncify(cls: type[authentication_revoke_tokenRevokeToken]) -> type[authentication_revoke_token_RevokeTokenAsync]: ... +@overload +def asyncify(cls: type[authentication_socialSocial]) -> type[authentication_social_SocialAsync]: ... +@overload +def asyncify(cls: type[authentication_baseAuthenticationBase]) -> type[authentication_base_AuthenticationBaseAsync]: ... +@overload +def asyncify(cls: type[authentication_usersUsers]) -> type[authentication_users_UsersAsync]: ... +@overload +def asyncify(cls: type[management_actionsActions]) -> type[management_actions_ActionsAsync]: ... +@overload +def asyncify( + cls: type[management_attack_protectionAttackProtection], +) -> type[management_attack_protection_AttackProtectionAsync]: ... +@overload +def asyncify(cls: type[management_blacklistsBlacklists]) -> type[management_blacklists_BlacklistsAsync]: ... +@overload +def asyncify(cls: type[management_brandingBranding]) -> type[management_branding_BrandingAsync]: ... +@overload +def asyncify(cls: type[management_clientsClients]) -> type[management_clients_ClientsAsync]: ... +@overload +def asyncify( + cls: type[management_client_credentialsClientCredentials], +) -> type[management_client_credentials_ClientCredentialsAsync]: ... +@overload +def asyncify(cls: type[management_client_grantsClientGrants]) -> type[management_client_grants_ClientGrantsAsync]: ... +@overload +def asyncify(cls: type[management_connectionsConnections]) -> type[management_connections_ConnectionsAsync]: ... +@overload +def asyncify(cls: type[management_custom_domainsCustomDomains]) -> type[management_custom_domains_CustomDomainsAsync]: ... +@overload +def asyncify( + cls: type[management_device_credentialsDeviceCredentials], +) -> type[management_device_credentials_DeviceCredentialsAsync]: ... +@overload +def asyncify(cls: type[management_emailsEmails]) -> type[management_emails_EmailsAsync]: ... +@overload +def asyncify(cls: type[management_email_templatesEmailTemplates]) -> type[management_email_templates_EmailTemplatesAsync]: ... +@overload +def asyncify(cls: type[management_grantsGrants]) -> type[management_grants_GrantsAsync]: ... +@overload +def asyncify(cls: type[management_guardianGuardian]) -> type[management_guardian_GuardianAsync]: ... +@overload +def asyncify(cls: type[management_hooksHooks]) -> type[management_hooks_HooksAsync]: ... +@overload +def asyncify(cls: type[management_jobsJobs]) -> type[management_jobs_JobsAsync]: ... +@overload +def asyncify(cls: type[management_logsLogs]) -> type[management_logs_LogsAsync]: ... +@overload +def asyncify(cls: type[management_log_streamsLogStreams]) -> type[management_log_streams_LogStreamsAsync]: ... +@overload +def asyncify(cls: type[management_organizationsOrganizations]) -> type[management_organizations_OrganizationsAsync]: ... +@overload +def asyncify(cls: type[management_promptsPrompts]) -> type[management_prompts_PromptsAsync]: ... +@overload +def asyncify(cls: type[management_resource_serversResourceServers]) -> type[management_resource_servers_ResourceServersAsync]: ... +@overload +def asyncify(cls: type[management_rolesRoles]) -> type[management_roles_RolesAsync]: ... +@overload +def asyncify(cls: type[management_rulesRules]) -> type[management_rules_RulesAsync]: ... +@overload +def asyncify(cls: type[management_rules_configsRulesConfigs]) -> type[management_rules_configs_RulesConfigsAsync]: ... +@overload +def asyncify(cls: type[management_statsStats]) -> type[management_stats_StatsAsync]: ... +@overload +def asyncify(cls: type[management_tenantsTenants]) -> type[management_tenants_TenantsAsync]: ... +@overload +def asyncify(cls: type[management_ticketsTickets]) -> type[management_tickets_TicketsAsync]: ... +@overload +def asyncify(cls: type[management_usersUsers]) -> type[management_users_UsersAsync]: ... +@overload +def asyncify(cls: type[management_users_by_emailUsersByEmail]) -> type[management_users_by_email_UsersByEmailAsync]: ... +@overload +def asyncify(cls: type[management_user_blocksUserBlocks]) -> type[management_user_blocks_UserBlocksAsync]: ... +@overload +def asyncify(cls: type[_T]) -> type[_T]: ... diff --git a/stubs/auth0-python/auth0/management/async_auth0.pyi b/stubs/auth0-python/auth0/management/async_auth0.pyi index 4e5f34c430ef..b4d4b37999f5 100644 --- a/stubs/auth0-python/auth0/management/async_auth0.pyi +++ b/stubs/auth0-python/auth0/management/async_auth0.pyi @@ -4,7 +4,7 @@ from typing_extensions import Self import aiohttp from auth0.rest import RestClientOptions -# Relative import climbs too many namespaces +# ignore: Relative import climbs too many namespaces from .._asyncified.management.actions import _ActionsAsync # type: ignore[misc] from .._asyncified.management.attack_protection import _AttackProtectionAsync # type: ignore[misc] from .._asyncified.management.blacklists import _BlacklistsAsync # type: ignore[misc] From 7333d9839c9e3270e40517240a047a7a747c1ce3 Mon Sep 17 00:00:00 2001 From: Avasam Date: Mon, 14 Apr 2025 15:26:33 -0400 Subject: [PATCH 04/12] _KNOWN_METADATA_FIELDS 'mypy-tests' --- lib/ts_utils/metadata.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/ts_utils/metadata.py b/lib/ts_utils/metadata.py index f851ce536519..ec30f9301425 100644 --- a/lib/ts_utils/metadata.py +++ b/lib/ts_utils/metadata.py @@ -166,6 +166,7 @@ def is_obsolete(self) -> bool: "tool", "partial_stub", "requires_python", + "mypy-tests", } ) _KNOWN_METADATA_TOOL_FIELDS: Final = { From 1f14a5f1941d0f2f585e707b4ffc0439c9f2341c Mon Sep 17 00:00:00 2001 From: Avasam Date: Mon, 14 Apr 2025 15:34:23 -0400 Subject: [PATCH 05/12] More concise check even if technically slower --- scripts/sync_auth0_python.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/scripts/sync_auth0_python.py b/scripts/sync_auth0_python.py index 438c9a6ff3c1..ba6af800ce2d 100644 --- a/scripts/sync_auth0_python.py +++ b/scripts/sync_auth0_python.py @@ -46,11 +46,7 @@ def modify_stubs() -> list[tuple[str, str]]: # Only keep imports, classes and public non-special methods stub_content = "".join( - [ - line - for line in lines - if "def _" not in line and any(True for check in KEEP_LINES_STARTSWITH if line.startswith(check)) - ] + filter(lambda line: "def _" not in line and any(line.startswith(check) for check in KEEP_LINES_STARTSWITH), lines) ) base_classes_for_overload.extend([(relative_module, match) for match in re.findall(BASE_CLASS_RE, stub_content)]) From fccc7d2938281671754b1127403bd2c96fa7d170 Mon Sep 17 00:00:00 2001 From: Avasam Date: Mon, 14 Apr 2025 15:46:10 -0400 Subject: [PATCH 06/12] More constants --- scripts/sync_auth0_python.py | 48 ++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 27 deletions(-) diff --git a/scripts/sync_auth0_python.py b/scripts/sync_auth0_python.py index ba6af800ce2d..70fdc73edd1d 100644 --- a/scripts/sync_auth0_python.py +++ b/scripts/sync_auth0_python.py @@ -7,27 +7,32 @@ from subprocess import check_call, run from textwrap import dedent -_ASYNCIFIED_PATH = Path("stubs/auth0-python/auth0/_asyncified") +ASYNCIFIED_PATH = Path("stubs/auth0-python/auth0/_asyncified") +ASYNCIFY_PYI_PATH = ASYNCIFIED_PATH.parent / "asyncify.pyi" KEEP_LINES_STARTSWITH = ("from ", "import ", " def ", "class ", "\n") +AUTO_GENERATED_COMMENT = "# AUTOGENERATED BY scripts/sync_auth0_python.py" BASE_CLASS_RE = re.compile(r"class (\w+?):") SUBCLASS_RE = re.compile(r"class (\w+?)\((\w+?)\):") +AS_IMPORT_RE = re.compile(r"(.+?) as \1") +IMPORT_TO_ASYNCIFY_RE = re.compile(r"(from \.\w+? import )(\w+?)\n") +METHOD_TO_ASYNCIFY_RE = re.compile(r" def (.+?)\(") def generate_stubs() -> None: - check_call(("stubgen", "-p", "auth0.authentication", "-p", "auth0.management", "-o", _ASYNCIFIED_PATH)) + check_call(("stubgen", "-p", "auth0.authentication", "-p", "auth0.management", "-o", ASYNCIFIED_PATH)) # Move the generated stubs to the right place - shutil.copytree(_ASYNCIFIED_PATH / "auth0", _ASYNCIFIED_PATH, copy_function=shutil.move, dirs_exist_ok=True) - shutil.rmtree(_ASYNCIFIED_PATH / "auth0") + shutil.copytree(ASYNCIFIED_PATH / "auth0", ASYNCIFIED_PATH, copy_function=shutil.move, dirs_exist_ok=True) + shutil.rmtree(ASYNCIFIED_PATH / "auth0") for path_to_remove in ( - (_ASYNCIFIED_PATH / "authentication" / "__init__.pyi"), - (_ASYNCIFIED_PATH / "management" / "__init__.pyi"), + (ASYNCIFIED_PATH / "authentication" / "__init__.pyi"), + (ASYNCIFIED_PATH / "management" / "__init__.pyi"), *chain.from_iterable( [ (already_async, already_async.with_name(already_async.name.removeprefix("async_"))) - for already_async in _ASYNCIFIED_PATH.rglob("async_*.pyi") + for already_async in ASYNCIFIED_PATH.rglob("async_*.pyi") ] ), ): @@ -39,10 +44,10 @@ def modify_stubs() -> list[tuple[str, str]]: subclasses_for_overload: list[tuple[str, str]] = [] # Cleanup and modify the stubs - for stub_path in _ASYNCIFIED_PATH.rglob("*.pyi"): + for stub_path in ASYNCIFIED_PATH.rglob("*.pyi"): with stub_path.open() as stub_file: lines = stub_file.readlines() - relative_module = (stub_path.relative_to(_ASYNCIFIED_PATH).with_suffix("").as_posix()).replace("/", ".") + relative_module = (stub_path.relative_to(ASYNCIFIED_PATH).with_suffix("").as_posix()).replace("/", ".") # Only keep imports, classes and public non-special methods stub_content = "".join( @@ -53,11 +58,11 @@ def modify_stubs() -> list[tuple[str, str]]: subclasses_for_overload.extend([(relative_module, groups[0]) for groups in re.findall(SUBCLASS_RE, stub_content)]) # Remove redundant ` as ` imports - stub_content = re.sub(r"(.+?) as \1", "\\1", stub_content) + stub_content = re.sub(AS_IMPORT_RE, "\\1", stub_content) # Fix relative imports stub_content = stub_content.replace("from ..", "from ...") # Rename same-level local imports to use transformed class names ahead of time - stub_content = re.sub(r"(from \.\w+? import )(\w+?)\n", "\\1_\\2Async\n", stub_content) + stub_content = re.sub(IMPORT_TO_ASYNCIFY_RE, "\\1_\\2Async\n", stub_content) # Prep extra imports stub_content = "from typing import type_check_only\n" + stub_content @@ -84,11 +89,11 @@ class _\\1Async(\\1):""" stub_content, ) # Update methods to their asyncified variant - stub_content = re.sub(r" def (.+?)\(", " async def \\1_async(", stub_content) + stub_content = re.sub(METHOD_TO_ASYNCIFY_RE, " async def \\1_async(", stub_content) # Fix empty classes stub_content = stub_content.replace("):\n\n", "): ...\n\n") - stub_path.write_text("# AUTOGENERATED BY scripts/sync_auth0_python.py\n" + stub_content) + stub_path.write_text(f"{AUTO_GENERATED_COMMENT}\n{stub_content}") # Broader types last return subclasses_for_overload + base_classes_for_overload @@ -105,9 +110,9 @@ def generate_asyncify_pyi(classes_for_overload: Iterable[tuple[str, str]]) -> No imports += f"from ._asyncified.{relative_module} import {async_class_name} as {deduped_async_class_name}\n" overloads += f"@overload\ndef asyncify(cls: type[{deduped_class_name}]) -> type[{deduped_async_class_name}]: ...\n" - (_ASYNCIFIED_PATH.parent / "asyncify.pyi").write_text( + ASYNCIFY_PYI_PATH.write_text( f"""\ -# AUTOGENERATED BY scripts/sync_auth0_python.py +{AUTO_GENERATED_COMMENT} from typing import overload, TypeVar {imports} @@ -125,18 +130,7 @@ def main() -> None: classes_for_overload = modify_stubs() generate_asyncify_pyi(classes_for_overload) - run( - ( - sys.executable, - "-m", - "pre_commit", - "run", - "--files", - *_ASYNCIFIED_PATH.rglob("*.pyi"), - _ASYNCIFIED_PATH.parent / "asyncify.pyi", - ), - check=False, - ) + run((sys.executable, "-m", "pre_commit", "run", "--files", *ASYNCIFIED_PATH.rglob("*.pyi"), ASYNCIFY_PYI_PATH), check=False) if __name__ == "__main__": From a660a85d5bfa7d1c26577b161e75938366667882 Mon Sep 17 00:00:00 2001 From: Avasam Date: Mon, 14 Apr 2025 16:00:58 -0400 Subject: [PATCH 07/12] Add back deleted files for this demo --- .../auth0/authentication/__init__.pyi | 10 ++ .../authentication/async_token_verifier.pyi | 25 ++++ .../authentication/back_channel_login.pyi | 4 + .../auth0/authentication/base.pyi | 32 +++++ .../authentication/client_authentication.pyi | 13 ++ .../auth0/authentication/database.pyi | 21 +++ .../auth0/authentication/delegated.pyi | 12 ++ .../auth0/authentication/enterprise.pyi | 5 + .../auth0/authentication/get_token.pyi | 29 ++++ .../auth0/authentication/passwordless.pyi | 5 + .../pushed_authorization_requests.pyi | 4 + .../auth0/authentication/revoke_token.pyi | 4 + .../auth0/authentication/social.pyi | 4 + .../auth0/authentication/token_verifier.pyi | 29 ++++ .../auth0/authentication/users.pyi | 11 ++ stubs/auth0-python/auth0/exceptions.pyi | 14 ++ .../auth0/management/__init__.pyi | 63 ++++++++ .../auth0-python/auth0/management/actions.pyi | 64 +++++++++ .../auth0/management/attack_protection.pyi | 30 ++++ stubs/auth0-python/auth0/management/auth0.pyi | 67 +++++++++ .../auth0/management/blacklists.pyi | 21 +++ .../auth0/management/branding.pyi | 38 +++++ .../auth0/management/client_credentials.pyi | 26 ++++ .../auth0/management/client_grants.pyi | 60 ++++++++ .../auth0-python/auth0/management/clients.pyi | 44 ++++++ .../auth0/management/connections.pyi | 48 +++++++ .../auth0/management/custom_domains.pyi | 28 ++++ .../auth0/management/device_credentials.pyi | 44 ++++++ .../auth0/management/email_templates.pyi | 24 ++++ .../auth0-python/auth0/management/emails.pyi | 26 ++++ .../auth0-python/auth0/management/grants.pyi | 34 +++++ .../auth0/management/guardian.pyi | 38 +++++ stubs/auth0-python/auth0/management/hooks.pyi | 52 +++++++ stubs/auth0-python/auth0/management/jobs.pyi | 42 ++++++ .../auth0/management/log_streams.pyi | 29 ++++ stubs/auth0-python/auth0/management/logs.pyi | 44 ++++++ .../auth0/management/organizations.pyi | 134 ++++++++++++++++++ .../auth0-python/auth0/management/prompts.pyi | 28 ++++ .../auth0/management/resource_servers.pyi | 28 ++++ stubs/auth0-python/auth0/management/roles.pyi | 63 ++++++++ stubs/auth0-python/auth0/management/rules.pyi | 46 ++++++ .../auth0/management/rules_configs.pyi | 24 ++++ stubs/auth0-python/auth0/management/stats.pyi | 24 ++++ .../auth0-python/auth0/management/tenants.pyi | 22 +++ .../auth0-python/auth0/management/tickets.pyi | 22 +++ .../auth0/management/user_blocks.pyi | 26 ++++ stubs/auth0-python/auth0/management/users.pyi | 119 ++++++++++++++++ .../auth0/management/users_by_email.pyi | 24 ++++ stubs/auth0-python/auth0/rest.pyi | 49 +++++++ stubs/auth0-python/auth0/rest_async.pyi | 28 ++++ stubs/auth0-python/auth0/types.pyi | 5 + stubs/auth0-python/auth0/utils.pyi | 1 + 52 files changed, 1687 insertions(+) create mode 100644 stubs/auth0-python/auth0/authentication/__init__.pyi create mode 100644 stubs/auth0-python/auth0/authentication/async_token_verifier.pyi create mode 100644 stubs/auth0-python/auth0/authentication/back_channel_login.pyi create mode 100644 stubs/auth0-python/auth0/authentication/base.pyi create mode 100644 stubs/auth0-python/auth0/authentication/client_authentication.pyi create mode 100644 stubs/auth0-python/auth0/authentication/database.pyi create mode 100644 stubs/auth0-python/auth0/authentication/delegated.pyi create mode 100644 stubs/auth0-python/auth0/authentication/enterprise.pyi create mode 100644 stubs/auth0-python/auth0/authentication/get_token.pyi create mode 100644 stubs/auth0-python/auth0/authentication/passwordless.pyi create mode 100644 stubs/auth0-python/auth0/authentication/pushed_authorization_requests.pyi create mode 100644 stubs/auth0-python/auth0/authentication/revoke_token.pyi create mode 100644 stubs/auth0-python/auth0/authentication/social.pyi create mode 100644 stubs/auth0-python/auth0/authentication/token_verifier.pyi create mode 100644 stubs/auth0-python/auth0/authentication/users.pyi create mode 100644 stubs/auth0-python/auth0/exceptions.pyi create mode 100644 stubs/auth0-python/auth0/management/__init__.pyi create mode 100644 stubs/auth0-python/auth0/management/actions.pyi create mode 100644 stubs/auth0-python/auth0/management/attack_protection.pyi create mode 100644 stubs/auth0-python/auth0/management/auth0.pyi create mode 100644 stubs/auth0-python/auth0/management/blacklists.pyi create mode 100644 stubs/auth0-python/auth0/management/branding.pyi create mode 100644 stubs/auth0-python/auth0/management/client_credentials.pyi create mode 100644 stubs/auth0-python/auth0/management/client_grants.pyi create mode 100644 stubs/auth0-python/auth0/management/clients.pyi create mode 100644 stubs/auth0-python/auth0/management/connections.pyi create mode 100644 stubs/auth0-python/auth0/management/custom_domains.pyi create mode 100644 stubs/auth0-python/auth0/management/device_credentials.pyi create mode 100644 stubs/auth0-python/auth0/management/email_templates.pyi create mode 100644 stubs/auth0-python/auth0/management/emails.pyi create mode 100644 stubs/auth0-python/auth0/management/grants.pyi create mode 100644 stubs/auth0-python/auth0/management/guardian.pyi create mode 100644 stubs/auth0-python/auth0/management/hooks.pyi create mode 100644 stubs/auth0-python/auth0/management/jobs.pyi create mode 100644 stubs/auth0-python/auth0/management/log_streams.pyi create mode 100644 stubs/auth0-python/auth0/management/logs.pyi create mode 100644 stubs/auth0-python/auth0/management/organizations.pyi create mode 100644 stubs/auth0-python/auth0/management/prompts.pyi create mode 100644 stubs/auth0-python/auth0/management/resource_servers.pyi create mode 100644 stubs/auth0-python/auth0/management/roles.pyi create mode 100644 stubs/auth0-python/auth0/management/rules.pyi create mode 100644 stubs/auth0-python/auth0/management/rules_configs.pyi create mode 100644 stubs/auth0-python/auth0/management/stats.pyi create mode 100644 stubs/auth0-python/auth0/management/tenants.pyi create mode 100644 stubs/auth0-python/auth0/management/tickets.pyi create mode 100644 stubs/auth0-python/auth0/management/user_blocks.pyi create mode 100644 stubs/auth0-python/auth0/management/users.pyi create mode 100644 stubs/auth0-python/auth0/management/users_by_email.pyi create mode 100644 stubs/auth0-python/auth0/rest.pyi create mode 100644 stubs/auth0-python/auth0/rest_async.pyi create mode 100644 stubs/auth0-python/auth0/types.pyi create mode 100644 stubs/auth0-python/auth0/utils.pyi diff --git a/stubs/auth0-python/auth0/authentication/__init__.pyi b/stubs/auth0-python/auth0/authentication/__init__.pyi new file mode 100644 index 000000000000..d6263712af40 --- /dev/null +++ b/stubs/auth0-python/auth0/authentication/__init__.pyi @@ -0,0 +1,10 @@ +from .database import Database as Database +from .delegated import Delegated as Delegated +from .enterprise import Enterprise as Enterprise +from .get_token import GetToken as GetToken +from .passwordless import Passwordless as Passwordless +from .revoke_token import RevokeToken as RevokeToken +from .social import Social as Social +from .users import Users as Users + +__all__ = ("Database", "Delegated", "Enterprise", "GetToken", "Passwordless", "RevokeToken", "Social", "Users") diff --git a/stubs/auth0-python/auth0/authentication/async_token_verifier.pyi b/stubs/auth0-python/auth0/authentication/async_token_verifier.pyi new file mode 100644 index 000000000000..3880c4a6c7e2 --- /dev/null +++ b/stubs/auth0-python/auth0/authentication/async_token_verifier.pyi @@ -0,0 +1,25 @@ +from .. import TokenValidationError as TokenValidationError +from ..rest_async import AsyncRestClient as AsyncRestClient +from .token_verifier import ( + AsymmetricSignatureVerifier as AsymmetricSignatureVerifier, + JwksFetcher as JwksFetcher, + TokenVerifier as TokenVerifier, +) + +class AsyncAsymmetricSignatureVerifier(AsymmetricSignatureVerifier): + def __init__(self, jwks_url: str, algorithm: str = "RS256") -> None: ... + def set_session(self, session) -> None: ... + +class AsyncJwksFetcher(JwksFetcher): + def __init__(self, *args, **kwargs) -> None: ... + def set_session(self, session) -> None: ... + async def get_key(self, key_id: str): ... + +class AsyncTokenVerifier(TokenVerifier): + iss: str + aud: str + leeway: int + def __init__( + self, signature_verifier: AsyncAsymmetricSignatureVerifier, issuer: str, audience: str, leeway: int = 0 + ) -> None: ... + def set_session(self, session) -> None: ... diff --git a/stubs/auth0-python/auth0/authentication/back_channel_login.pyi b/stubs/auth0-python/auth0/authentication/back_channel_login.pyi new file mode 100644 index 000000000000..7e45855fa264 --- /dev/null +++ b/stubs/auth0-python/auth0/authentication/back_channel_login.pyi @@ -0,0 +1,4 @@ +from .base import AuthenticationBase as AuthenticationBase + +class BackChannelLogin(AuthenticationBase): + def back_channel_login(self, binding_message: str, login_hint: str, scope: str, **kwargs): ... diff --git a/stubs/auth0-python/auth0/authentication/base.pyi b/stubs/auth0-python/auth0/authentication/base.pyi new file mode 100644 index 000000000000..30c6021462cf --- /dev/null +++ b/stubs/auth0-python/auth0/authentication/base.pyi @@ -0,0 +1,32 @@ +from _typeshed import Incomplete +from typing import Final + +from auth0.rest import RestClient as RestClient, RestClientOptions as RestClientOptions +from auth0.types import RequestData as RequestData + +from .client_authentication import add_client_authentication as add_client_authentication + +UNKNOWN_ERROR: Final[str] + +class AuthenticationBase: + domain: str + client_id: str + client_secret: str | None + client_assertion_signing_key: str | None + client_assertion_signing_alg: str | None + protocol: str + client: RestClient + def __init__( + self, + domain: str, + client_id: str, + client_secret: str | None = None, + client_assertion_signing_key: str | None = None, + client_assertion_signing_alg: str | None = None, + telemetry: bool = True, + timeout: float | tuple[float, float] = 5.0, + protocol: str = "https", + ) -> None: ... + def post(self, url: str, data: RequestData | None = None, headers: dict[str, str] | None = None): ... + def authenticated_post(self, url: str, data: dict[str, Incomplete], headers: dict[str, str] | None = None): ... + def get(self, url: str, params: dict[str, Incomplete] | None = None, headers: dict[str, str] | None = None): ... diff --git a/stubs/auth0-python/auth0/authentication/client_authentication.pyi b/stubs/auth0-python/auth0/authentication/client_authentication.pyi new file mode 100644 index 000000000000..e75647fe00f5 --- /dev/null +++ b/stubs/auth0-python/auth0/authentication/client_authentication.pyi @@ -0,0 +1,13 @@ +from _typeshed import Incomplete + +def create_client_assertion_jwt( + domain: str, client_id: str, client_assertion_signing_key: str, client_assertion_signing_alg: str | None +) -> str: ... +def add_client_authentication( + payload: dict[str, Incomplete], + domain: str, + client_id: str, + client_secret: str | None, + client_assertion_signing_key: str | None, + client_assertion_signing_alg: str | None, +) -> dict[str, Incomplete]: ... diff --git a/stubs/auth0-python/auth0/authentication/database.pyi b/stubs/auth0-python/auth0/authentication/database.pyi new file mode 100644 index 000000000000..e08752c27897 --- /dev/null +++ b/stubs/auth0-python/auth0/authentication/database.pyi @@ -0,0 +1,21 @@ +from _typeshed import Incomplete + +from .base import AuthenticationBase as AuthenticationBase + +class Database(AuthenticationBase): + def signup( + self, + email: str, + password: str, + connection: str, + username: str | None = None, + user_metadata: dict[str, Incomplete] | None = None, + given_name: str | None = None, + family_name: str | None = None, + name: str | None = None, + nickname: str | None = None, + picture: str | None = None, + ) -> dict[str, Incomplete]: ... + def change_password( + self, email: str, connection: str, password: str | None = None, organization: str | None = None + ) -> str: ... diff --git a/stubs/auth0-python/auth0/authentication/delegated.pyi b/stubs/auth0-python/auth0/authentication/delegated.pyi new file mode 100644 index 000000000000..cedc50b05e6d --- /dev/null +++ b/stubs/auth0-python/auth0/authentication/delegated.pyi @@ -0,0 +1,12 @@ +from .base import AuthenticationBase as AuthenticationBase + +class Delegated(AuthenticationBase): + def get_token( + self, + target: str, + api_type: str, + grant_type: str, + id_token: str | None = None, + refresh_token: str | None = None, + scope: str = "openid", + ): ... diff --git a/stubs/auth0-python/auth0/authentication/enterprise.pyi b/stubs/auth0-python/auth0/authentication/enterprise.pyi new file mode 100644 index 000000000000..a438ec9a0fad --- /dev/null +++ b/stubs/auth0-python/auth0/authentication/enterprise.pyi @@ -0,0 +1,5 @@ +from .base import AuthenticationBase as AuthenticationBase + +class Enterprise(AuthenticationBase): + def saml_metadata(self): ... + def wsfed_metadata(self): ... diff --git a/stubs/auth0-python/auth0/authentication/get_token.pyi b/stubs/auth0-python/auth0/authentication/get_token.pyi new file mode 100644 index 000000000000..02590cf34a17 --- /dev/null +++ b/stubs/auth0-python/auth0/authentication/get_token.pyi @@ -0,0 +1,29 @@ +from .base import AuthenticationBase as AuthenticationBase + +class GetToken(AuthenticationBase): + def authorization_code(self, code: str, redirect_uri: str | None, grant_type: str = "authorization_code"): ... + def authorization_code_pkce( + self, code_verifier: str, code: str, redirect_uri: str | None, grant_type: str = "authorization_code" + ): ... + def client_credentials(self, audience: str, grant_type: str = "client_credentials", organization: str | None = None): ... + def login( + self, + username: str, + password: str, + scope: str | None = None, + realm: str | None = None, + audience: str | None = None, + grant_type: str = "http://auth0.com/oauth/grant-type/password-realm", + forwarded_for: str | None = None, + ): ... + def refresh_token(self, refresh_token: str, scope: str = "", grant_type: str = "refresh_token"): ... + def passwordless_login(self, username: str, otp: str, realm: str, scope: str, audience: str): ... + def backchannel_login(self, auth_req_id: str, grant_type: str = "urn:openid:params:grant-type:ciba"): ... + def access_token_for_connection( + self, + subject_token_type: str, + subject_token: str, + requested_token_type: str, + connection: str | None = None, + grant_type: str = ..., + ): ... diff --git a/stubs/auth0-python/auth0/authentication/passwordless.pyi b/stubs/auth0-python/auth0/authentication/passwordless.pyi new file mode 100644 index 000000000000..841c6f4fcc9c --- /dev/null +++ b/stubs/auth0-python/auth0/authentication/passwordless.pyi @@ -0,0 +1,5 @@ +from .base import AuthenticationBase as AuthenticationBase + +class Passwordless(AuthenticationBase): + def email(self, email: str, send: str = "link", auth_params: dict[str, str] | None = None): ... + def sms(self, phone_number: str): ... diff --git a/stubs/auth0-python/auth0/authentication/pushed_authorization_requests.pyi b/stubs/auth0-python/auth0/authentication/pushed_authorization_requests.pyi new file mode 100644 index 000000000000..67bdc0074e35 --- /dev/null +++ b/stubs/auth0-python/auth0/authentication/pushed_authorization_requests.pyi @@ -0,0 +1,4 @@ +from .base import AuthenticationBase as AuthenticationBase + +class PushedAuthorizationRequests(AuthenticationBase): + def pushed_authorization_request(self, response_type: str, redirect_uri: str, **kwargs): ... diff --git a/stubs/auth0-python/auth0/authentication/revoke_token.pyi b/stubs/auth0-python/auth0/authentication/revoke_token.pyi new file mode 100644 index 000000000000..7190be6c6535 --- /dev/null +++ b/stubs/auth0-python/auth0/authentication/revoke_token.pyi @@ -0,0 +1,4 @@ +from .base import AuthenticationBase as AuthenticationBase + +class RevokeToken(AuthenticationBase): + def revoke_refresh_token(self, token: str): ... diff --git a/stubs/auth0-python/auth0/authentication/social.pyi b/stubs/auth0-python/auth0/authentication/social.pyi new file mode 100644 index 000000000000..b63c702fd934 --- /dev/null +++ b/stubs/auth0-python/auth0/authentication/social.pyi @@ -0,0 +1,4 @@ +from .base import AuthenticationBase as AuthenticationBase + +class Social(AuthenticationBase): + def login(self, access_token: str, connection: str, scope: str = "openid"): ... diff --git a/stubs/auth0-python/auth0/authentication/token_verifier.pyi b/stubs/auth0-python/auth0/authentication/token_verifier.pyi new file mode 100644 index 000000000000..171e55501f9b --- /dev/null +++ b/stubs/auth0-python/auth0/authentication/token_verifier.pyi @@ -0,0 +1,29 @@ +from _typeshed import Incomplete +from typing import ClassVar + +from auth0.exceptions import TokenValidationError as TokenValidationError + +class SignatureVerifier: + DISABLE_JWT_CHECKS: ClassVar[dict[str, bool]] + def __init__(self, algorithm: str) -> None: ... + async def verify_signature(self, token: str) -> dict[str, Incomplete]: ... + +class SymmetricSignatureVerifier(SignatureVerifier): + def __init__(self, shared_secret: str, algorithm: str = "HS256") -> None: ... + +class JwksFetcher: + CACHE_TTL: ClassVar[int] + def __init__(self, jwks_url: str, cache_ttl: int = ...) -> None: ... + def get_key(self, key_id: str): ... + +class AsymmetricSignatureVerifier(SignatureVerifier): + def __init__(self, jwks_url: str, algorithm: str = "RS256", cache_ttl: int = ...) -> None: ... + +class TokenVerifier: + iss: str + aud: str + leeway: int + def __init__(self, signature_verifier: SignatureVerifier, issuer: str, audience: str, leeway: int = 0) -> None: ... + def verify( + self, token: str, nonce: str | None = None, max_age: int | None = None, organization: str | None = None + ) -> dict[str, Incomplete]: ... diff --git a/stubs/auth0-python/auth0/authentication/users.pyi b/stubs/auth0-python/auth0/authentication/users.pyi new file mode 100644 index 000000000000..c986cbc2fcae --- /dev/null +++ b/stubs/auth0-python/auth0/authentication/users.pyi @@ -0,0 +1,11 @@ +from _typeshed import Incomplete + +from auth0.rest import RestClient as RestClient, RestClientOptions as RestClientOptions +from auth0.types import TimeoutType as TimeoutType + +class Users: + domain: str + protocol: str + client: RestClient + def __init__(self, domain: str, telemetry: bool = True, timeout: TimeoutType = 5.0, protocol: str = "https") -> None: ... + def userinfo(self, access_token: str) -> dict[str, Incomplete]: ... diff --git a/stubs/auth0-python/auth0/exceptions.pyi b/stubs/auth0-python/auth0/exceptions.pyi new file mode 100644 index 000000000000..22a62ca6d727 --- /dev/null +++ b/stubs/auth0-python/auth0/exceptions.pyi @@ -0,0 +1,14 @@ +from _typeshed import Incomplete + +class Auth0Error(Exception): + status_code: int + error_code: str + message: str + content: Incomplete | None + def __init__(self, status_code: int, error_code: str, message: str, content: Incomplete | None = None) -> None: ... + +class RateLimitError(Auth0Error): + reset_at: int + def __init__(self, error_code: str, message: str, reset_at: int) -> None: ... + +class TokenValidationError(Exception): ... diff --git a/stubs/auth0-python/auth0/management/__init__.pyi b/stubs/auth0-python/auth0/management/__init__.pyi new file mode 100644 index 000000000000..37f4aa7c2067 --- /dev/null +++ b/stubs/auth0-python/auth0/management/__init__.pyi @@ -0,0 +1,63 @@ +from .actions import Actions as Actions +from .attack_protection import AttackProtection as AttackProtection +from .auth0 import Auth0 as Auth0 +from .blacklists import Blacklists as Blacklists +from .branding import Branding as Branding +from .client_credentials import ClientCredentials as ClientCredentials +from .client_grants import ClientGrants as ClientGrants +from .clients import Clients as Clients +from .connections import Connections as Connections +from .custom_domains import CustomDomains as CustomDomains +from .device_credentials import DeviceCredentials as DeviceCredentials +from .email_templates import EmailTemplates as EmailTemplates +from .emails import Emails as Emails +from .grants import Grants as Grants +from .guardian import Guardian as Guardian +from .hooks import Hooks as Hooks +from .jobs import Jobs as Jobs +from .log_streams import LogStreams as LogStreams +from .logs import Logs as Logs +from .organizations import Organizations as Organizations +from .resource_servers import ResourceServers as ResourceServers +from .roles import Roles as Roles +from .rules import Rules as Rules +from .rules_configs import RulesConfigs as RulesConfigs +from .stats import Stats as Stats +from .tenants import Tenants as Tenants +from .tickets import Tickets as Tickets +from .user_blocks import UserBlocks as UserBlocks +from .users import Users as Users +from .users_by_email import UsersByEmail as UsersByEmail + +__all__ = ( + "Auth0", + "Actions", + "AttackProtection", + "Blacklists", + "Branding", + "ClientCredentials", + "ClientGrants", + "Clients", + "Connections", + "CustomDomains", + "DeviceCredentials", + "EmailTemplates", + "Emails", + "Grants", + "Guardian", + "Hooks", + "Jobs", + "LogStreams", + "Logs", + "Organizations", + "ResourceServers", + "Roles", + "RulesConfigs", + "Rules", + "Stats", + "Tenants", + "Tickets", + "UserBlocks", + "UsersByEmail", + "Users", +) diff --git a/stubs/auth0-python/auth0/management/actions.pyi b/stubs/auth0-python/auth0/management/actions.pyi new file mode 100644 index 000000000000..bce092dff25e --- /dev/null +++ b/stubs/auth0-python/auth0/management/actions.pyi @@ -0,0 +1,64 @@ +from _typeshed import Incomplete + +from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions +from ..types import TimeoutType as TimeoutType + +class Actions: + domain: Incomplete + protocol: Incomplete + client: Incomplete + def __init__( + self, + domain: str, + token: str, + telemetry: bool = True, + timeout: TimeoutType = 5.0, + protocol: str = "https", + rest_options: RestClientOptions | None = None, + ) -> None: ... + def get_actions( + self, + trigger_id: str | None = None, + action_name: str | None = None, + deployed: bool | None = None, + installed: bool = False, + page: int | None = None, + per_page: int | None = None, + ): ... + async def get_actions_async( + self, + trigger_id: str | None = None, + action_name: str | None = None, + deployed: bool | None = None, + installed: bool = False, + page: int | None = None, + per_page: int | None = None, + ): ... + def create_action(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def create_action_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + def update_action(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def update_action_async(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + def get_action(self, id: str) -> dict[str, Incomplete]: ... + async def get_action_async(self, id: str) -> dict[str, Incomplete]: ... + def delete_action(self, id: str, force: bool = False): ... + async def delete_action_async(self, id: str, force: bool = False): ... + def get_triggers(self) -> dict[str, Incomplete]: ... + async def get_triggers_async(self) -> dict[str, Incomplete]: ... + def get_execution(self, id: str) -> dict[str, Incomplete]: ... + async def get_execution_async(self, id: str) -> dict[str, Incomplete]: ... + def get_action_versions(self, id: str, page: int | None = None, per_page: int | None = None) -> dict[str, Incomplete]: ... + async def get_action_versions_async( + self, id: str, page: int | None = None, per_page: int | None = None + ) -> dict[str, Incomplete]: ... + def get_trigger_bindings(self, id: str, page: int | None = None, per_page: int | None = None) -> dict[str, Incomplete]: ... + async def get_trigger_bindings_async( + self, id: str, page: int | None = None, per_page: int | None = None + ) -> dict[str, Incomplete]: ... + def get_action_version(self, action_id: str, version_id: str) -> dict[str, Incomplete]: ... + async def get_action_version_async(self, action_id: str, version_id: str) -> dict[str, Incomplete]: ... + def deploy_action(self, id: str) -> dict[str, Incomplete]: ... + async def deploy_action_async(self, id: str) -> dict[str, Incomplete]: ... + def rollback_action_version(self, action_id: str, version_id: str) -> dict[str, Incomplete]: ... + async def rollback_action_version_async(self, action_id: str, version_id: str) -> dict[str, Incomplete]: ... + def update_trigger_bindings(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def update_trigger_bindings_async(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... diff --git a/stubs/auth0-python/auth0/management/attack_protection.pyi b/stubs/auth0-python/auth0/management/attack_protection.pyi new file mode 100644 index 000000000000..d84ecc180939 --- /dev/null +++ b/stubs/auth0-python/auth0/management/attack_protection.pyi @@ -0,0 +1,30 @@ +from _typeshed import Incomplete + +from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions +from ..types import TimeoutType as TimeoutType + +class AttackProtection: + domain: Incomplete + protocol: Incomplete + client: Incomplete + def __init__( + self, + domain: str, + token: str, + telemetry: bool = True, + timeout: TimeoutType = 5.0, + protocol: str = "https", + rest_options: RestClientOptions | None = None, + ) -> None: ... + def get_breached_password_detection(self) -> dict[str, Incomplete]: ... + async def get_breached_password_detection_async(self) -> dict[str, Incomplete]: ... + def update_breached_password_detection(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def update_breached_password_detection_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + def get_brute_force_protection(self) -> dict[str, Incomplete]: ... + async def get_brute_force_protection_async(self) -> dict[str, Incomplete]: ... + def update_brute_force_protection(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def update_brute_force_protection_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + def get_suspicious_ip_throttling(self) -> dict[str, Incomplete]: ... + async def get_suspicious_ip_throttling_async(self) -> dict[str, Incomplete]: ... + def update_suspicious_ip_throttling(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def update_suspicious_ip_throttling_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... diff --git a/stubs/auth0-python/auth0/management/auth0.pyi b/stubs/auth0-python/auth0/management/auth0.pyi new file mode 100644 index 000000000000..14f7e64caa38 --- /dev/null +++ b/stubs/auth0-python/auth0/management/auth0.pyi @@ -0,0 +1,67 @@ +from _typeshed import Incomplete + +from auth0.rest import RestClientOptions as RestClientOptions + +from .actions import Actions as Actions +from .attack_protection import AttackProtection as AttackProtection +from .blacklists import Blacklists as Blacklists +from .branding import Branding as Branding +from .client_credentials import ClientCredentials as ClientCredentials +from .client_grants import ClientGrants as ClientGrants +from .clients import Clients as Clients +from .connections import Connections as Connections +from .custom_domains import CustomDomains as CustomDomains +from .device_credentials import DeviceCredentials as DeviceCredentials +from .email_templates import EmailTemplates as EmailTemplates +from .emails import Emails as Emails +from .grants import Grants as Grants +from .guardian import Guardian as Guardian +from .hooks import Hooks as Hooks +from .jobs import Jobs as Jobs +from .log_streams import LogStreams as LogStreams +from .logs import Logs as Logs +from .organizations import Organizations as Organizations +from .prompts import Prompts as Prompts +from .resource_servers import ResourceServers as ResourceServers +from .roles import Roles as Roles +from .rules import Rules as Rules +from .rules_configs import RulesConfigs as RulesConfigs +from .stats import Stats as Stats +from .tenants import Tenants as Tenants +from .tickets import Tickets as Tickets +from .user_blocks import UserBlocks as UserBlocks +from .users import Users as Users +from .users_by_email import UsersByEmail as UsersByEmail + +class Auth0: + actions: Incomplete + attack_protection: Incomplete + blacklists: Incomplete + branding: Incomplete + client_credentials: Incomplete + client_grants: Incomplete + clients: Incomplete + connections: Incomplete + custom_domains: Incomplete + device_credentials: Incomplete + email_templates: Incomplete + emails: Incomplete + grants: Incomplete + guardian: Incomplete + hooks: Incomplete + jobs: Incomplete + log_streams: Incomplete + logs: Incomplete + organizations: Incomplete + prompts: Incomplete + resource_servers: Incomplete + roles: Incomplete + rules_configs: Incomplete + rules: Incomplete + stats: Incomplete + tenants: Incomplete + tickets: Incomplete + user_blocks: Incomplete + users_by_email: Incomplete + users: Incomplete + def __init__(self, domain: str, token: str, rest_options: RestClientOptions | None = None) -> None: ... diff --git a/stubs/auth0-python/auth0/management/blacklists.pyi b/stubs/auth0-python/auth0/management/blacklists.pyi new file mode 100644 index 000000000000..9baf22376176 --- /dev/null +++ b/stubs/auth0-python/auth0/management/blacklists.pyi @@ -0,0 +1,21 @@ +from _typeshed import Incomplete + +from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions +from ..types import TimeoutType as TimeoutType + +class Blacklists: + url: Incomplete + client: Incomplete + def __init__( + self, + domain: str, + token: str, + telemetry: bool = True, + timeout: TimeoutType = 5.0, + protocol: str = "https", + rest_options: RestClientOptions | None = None, + ) -> None: ... + def get(self, aud: str | None = None) -> list[dict[str, str]]: ... + async def get_async(self, aud: str | None = None) -> list[dict[str, str]]: ... + def create(self, jti: str, aud: str | None = None) -> dict[str, str]: ... + async def create_async(self, jti: str, aud: str | None = None) -> dict[str, str]: ... diff --git a/stubs/auth0-python/auth0/management/branding.pyi b/stubs/auth0-python/auth0/management/branding.pyi new file mode 100644 index 000000000000..71be39cf4b6b --- /dev/null +++ b/stubs/auth0-python/auth0/management/branding.pyi @@ -0,0 +1,38 @@ +from _typeshed import Incomplete + +from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions +from ..types import TimeoutType as TimeoutType + +class Branding: + domain: Incomplete + protocol: Incomplete + client: Incomplete + def __init__( + self, + domain: str, + token: str, + telemetry: bool = True, + timeout: TimeoutType = 5.0, + protocol: str = "https", + rest_options: RestClientOptions | None = None, + ) -> None: ... + def get(self) -> dict[str, Incomplete]: ... + async def get_async(self) -> dict[str, Incomplete]: ... + def update(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def update_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + def get_template_universal_login(self) -> dict[str, Incomplete]: ... + async def get_template_universal_login_async(self) -> dict[str, Incomplete]: ... + def delete_template_universal_login(self): ... + async def delete_template_universal_login_async(self): ... + def update_template_universal_login(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def update_template_universal_login_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + def get_default_branding_theme(self) -> dict[str, Incomplete]: ... + async def get_default_branding_theme_async(self) -> dict[str, Incomplete]: ... + def get_branding_theme(self, theme_id: str) -> dict[str, Incomplete]: ... + async def get_branding_theme_async(self, theme_id: str) -> dict[str, Incomplete]: ... + def delete_branding_theme(self, theme_id: str): ... + async def delete_branding_theme_async(self, theme_id: str): ... + def update_branding_theme(self, theme_id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def update_branding_theme_async(self, theme_id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + def create_branding_theme(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def create_branding_theme_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... diff --git a/stubs/auth0-python/auth0/management/client_credentials.pyi b/stubs/auth0-python/auth0/management/client_credentials.pyi new file mode 100644 index 000000000000..895f79bcc5ee --- /dev/null +++ b/stubs/auth0-python/auth0/management/client_credentials.pyi @@ -0,0 +1,26 @@ +from _typeshed import Incomplete + +from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions +from ..types import TimeoutType as TimeoutType + +class ClientCredentials: + domain: Incomplete + protocol: Incomplete + client: Incomplete + def __init__( + self, + domain: str, + token: str, + telemetry: bool = True, + timeout: TimeoutType = 5.0, + protocol: str = "https", + rest_options: RestClientOptions | None = None, + ) -> None: ... + def all(self, client_id: str) -> list[dict[str, Incomplete]]: ... + async def all_async(self, client_id: str) -> list[dict[str, Incomplete]]: ... + def get(self, client_id: str, id: str) -> dict[str, Incomplete]: ... + async def get_async(self, client_id: str, id: str) -> dict[str, Incomplete]: ... + def create(self, client_id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def create_async(self, client_id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + def delete(self, client_id: str, id: str) -> dict[str, Incomplete]: ... + async def delete_async(self, client_id: str, id: str) -> dict[str, Incomplete]: ... diff --git a/stubs/auth0-python/auth0/management/client_grants.pyi b/stubs/auth0-python/auth0/management/client_grants.pyi new file mode 100644 index 000000000000..bae2e974df3c --- /dev/null +++ b/stubs/auth0-python/auth0/management/client_grants.pyi @@ -0,0 +1,60 @@ +from _typeshed import Incomplete + +from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions +from ..types import TimeoutType as TimeoutType + +class ClientGrants: + domain: Incomplete + protocol: Incomplete + client: Incomplete + def __init__( + self, + domain: str, + token: str, + telemetry: bool = True, + timeout: TimeoutType = 5.0, + protocol: str = "https", + rest_options: RestClientOptions | None = None, + ) -> None: ... + def all( + self, + audience: str | None = None, + page: int | None = None, + per_page: int | None = None, + include_totals: bool = False, + client_id: str | None = None, + allow_any_organization: bool | None = None, + ) -> dict[str, Incomplete]: ... + async def all_async( + self, + audience: str | None = None, + page: int | None = None, + per_page: int | None = None, + include_totals: bool = False, + client_id: str | None = None, + allow_any_organization: bool | None = None, + ) -> dict[str, Incomplete]: ... + def create(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def create_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + def delete(self, id: str): ... + async def delete_async(self, id: str): ... + def update(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def update_async(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + def get_organizations( + self, + id: str, + page: int | None = None, + per_page: int | None = None, + include_totals: bool = False, + from_param: str | None = None, + take: int | None = None, + ) -> dict[str, Incomplete]: ... + async def get_organizations_async( + self, + id: str, + page: int | None = None, + per_page: int | None = None, + include_totals: bool = False, + from_param: str | None = None, + take: int | None = None, + ) -> dict[str, Incomplete]: ... diff --git a/stubs/auth0-python/auth0/management/clients.pyi b/stubs/auth0-python/auth0/management/clients.pyi new file mode 100644 index 000000000000..1144a33b3dff --- /dev/null +++ b/stubs/auth0-python/auth0/management/clients.pyi @@ -0,0 +1,44 @@ +from _typeshed import Incomplete + +from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions +from ..types import TimeoutType as TimeoutType + +class Clients: + domain: Incomplete + protocol: Incomplete + client: Incomplete + def __init__( + self, + domain: str, + token: str, + telemetry: bool = True, + timeout: TimeoutType = 5.0, + protocol: str = "https", + rest_options: RestClientOptions | None = None, + ) -> None: ... + def all( + self, + fields: list[str] | None = None, + include_fields: bool = True, + page: int | None = None, + per_page: int | None = None, + extra_params: dict[str, Incomplete] | None = None, + ) -> list[dict[str, Incomplete]]: ... + async def all_async( + self, + fields: list[str] | None = None, + include_fields: bool = True, + page: int | None = None, + per_page: int | None = None, + extra_params: dict[str, Incomplete] | None = None, + ) -> list[dict[str, Incomplete]]: ... + def create(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def create_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + def get(self, id: str, fields: list[str] | None = None, include_fields: bool = True) -> dict[str, Incomplete]: ... + async def get_async(self, id: str, fields: list[str] | None = None, include_fields: bool = True) -> dict[str, Incomplete]: ... + def delete(self, id: str): ... + async def delete_async(self, id: str): ... + def update(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def update_async(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + def rotate_secret(self, id: str) -> dict[str, Incomplete]: ... + async def rotate_secret_async(self, id: str) -> dict[str, Incomplete]: ... diff --git a/stubs/auth0-python/auth0/management/connections.pyi b/stubs/auth0-python/auth0/management/connections.pyi new file mode 100644 index 000000000000..a7b53124c8e6 --- /dev/null +++ b/stubs/auth0-python/auth0/management/connections.pyi @@ -0,0 +1,48 @@ +from _typeshed import Incomplete + +from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions +from ..types import TimeoutType as TimeoutType + +class Connections: + domain: Incomplete + protocol: Incomplete + client: Incomplete + def __init__( + self, + domain: str, + token: str, + telemetry: bool = True, + timeout: TimeoutType = 5.0, + protocol: str = "https", + rest_options: RestClientOptions | None = None, + ) -> None: ... + def all( + self, + strategy: str | None = None, + fields: list[str] | None = None, + include_fields: bool = True, + page: int | None = None, + per_page: int | None = None, + extra_params: dict[str, Incomplete] | None = None, + name: str | None = None, + ) -> list[dict[str, Incomplete]]: ... + async def all_async( + self, + strategy: str | None = None, + fields: list[str] | None = None, + include_fields: bool = True, + page: int | None = None, + per_page: int | None = None, + extra_params: dict[str, Incomplete] | None = None, + name: str | None = None, + ) -> list[dict[str, Incomplete]]: ... + def get(self, id: str, fields: list[str] | None = None, include_fields: bool = True) -> dict[str, Incomplete]: ... + async def get_async(self, id: str, fields: list[str] | None = None, include_fields: bool = True) -> dict[str, Incomplete]: ... + def delete(self, id: str): ... + async def delete_async(self, id: str): ... + def update(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def update_async(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + def create(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def create_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + def delete_user_by_email(self, id: str, email: str): ... + async def delete_user_by_email_async(self, id: str, email: str): ... diff --git a/stubs/auth0-python/auth0/management/custom_domains.pyi b/stubs/auth0-python/auth0/management/custom_domains.pyi new file mode 100644 index 000000000000..84b0a1859cb0 --- /dev/null +++ b/stubs/auth0-python/auth0/management/custom_domains.pyi @@ -0,0 +1,28 @@ +from _typeshed import Incomplete + +from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions +from ..types import TimeoutType as TimeoutType + +class CustomDomains: + domain: Incomplete + protocol: Incomplete + client: Incomplete + def __init__( + self, + domain: str, + token: str, + telemetry: bool = True, + timeout: TimeoutType = 5.0, + protocol: str = "https", + rest_options: RestClientOptions | None = None, + ) -> None: ... + def all(self) -> list[dict[str, Incomplete]]: ... + async def all_async(self) -> list[dict[str, Incomplete]]: ... + def get(self, id: str) -> dict[str, Incomplete]: ... + async def get_async(self, id: str) -> dict[str, Incomplete]: ... + def delete(self, id: str): ... + async def delete_async(self, id: str): ... + def create_new(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def create_new_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + def verify(self, id: str) -> dict[str, Incomplete]: ... + async def verify_async(self, id: str) -> dict[str, Incomplete]: ... diff --git a/stubs/auth0-python/auth0/management/device_credentials.pyi b/stubs/auth0-python/auth0/management/device_credentials.pyi new file mode 100644 index 000000000000..3d1f8e4f3a1b --- /dev/null +++ b/stubs/auth0-python/auth0/management/device_credentials.pyi @@ -0,0 +1,44 @@ +from _typeshed import Incomplete + +from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions +from ..types import TimeoutType as TimeoutType + +class DeviceCredentials: + domain: Incomplete + protocol: Incomplete + client: Incomplete + def __init__( + self, + domain: str, + token: str, + telemetry: bool = True, + timeout: TimeoutType = 5.0, + protocol: str = "https", + rest_options: RestClientOptions | None = None, + ) -> None: ... + def get( + self, + user_id: str, + client_id: str, + type: str, + fields: list[str] | None = None, + include_fields: bool = True, + page: int | None = None, + per_page: int | None = None, + include_totals: bool = False, + ): ... + async def get_async( + self, + user_id: str, + client_id: str, + type: str, + fields: list[str] | None = None, + include_fields: bool = True, + page: int | None = None, + per_page: int | None = None, + include_totals: bool = False, + ): ... + def create(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def create_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + def delete(self, id: str): ... + async def delete_async(self, id: str): ... diff --git a/stubs/auth0-python/auth0/management/email_templates.pyi b/stubs/auth0-python/auth0/management/email_templates.pyi new file mode 100644 index 000000000000..9a4e8919da65 --- /dev/null +++ b/stubs/auth0-python/auth0/management/email_templates.pyi @@ -0,0 +1,24 @@ +from _typeshed import Incomplete + +from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions +from ..types import TimeoutType as TimeoutType + +class EmailTemplates: + domain: Incomplete + protocol: Incomplete + client: Incomplete + def __init__( + self, + domain: str, + token: str, + telemetry: bool = True, + timeout: TimeoutType = 5.0, + protocol: str = "https", + rest_options: RestClientOptions | None = None, + ) -> None: ... + def create(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def create_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + def get(self, template_name: str) -> dict[str, Incomplete]: ... + async def get_async(self, template_name: str) -> dict[str, Incomplete]: ... + def update(self, template_name: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def update_async(self, template_name: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... diff --git a/stubs/auth0-python/auth0/management/emails.pyi b/stubs/auth0-python/auth0/management/emails.pyi new file mode 100644 index 000000000000..f681b1ea9150 --- /dev/null +++ b/stubs/auth0-python/auth0/management/emails.pyi @@ -0,0 +1,26 @@ +from _typeshed import Incomplete + +from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions +from ..types import TimeoutType as TimeoutType + +class Emails: + domain: Incomplete + protocol: Incomplete + client: Incomplete + def __init__( + self, + domain: str, + token: str, + telemetry: bool = True, + timeout: TimeoutType = 5.0, + protocol: str = "https", + rest_options: RestClientOptions | None = None, + ) -> None: ... + def get(self, fields: list[str] | None = None, include_fields: bool = True) -> dict[str, Incomplete]: ... + async def get_async(self, fields: list[str] | None = None, include_fields: bool = True) -> dict[str, Incomplete]: ... + def config(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def config_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + def delete(self): ... + async def delete_async(self): ... + def update(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def update_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... diff --git a/stubs/auth0-python/auth0/management/grants.pyi b/stubs/auth0-python/auth0/management/grants.pyi new file mode 100644 index 000000000000..e7946afc5a65 --- /dev/null +++ b/stubs/auth0-python/auth0/management/grants.pyi @@ -0,0 +1,34 @@ +from _typeshed import Incomplete + +from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions +from ..types import TimeoutType as TimeoutType + +class Grants: + domain: Incomplete + protocol: Incomplete + client: Incomplete + def __init__( + self, + domain: str, + token: str, + telemetry: bool = True, + timeout: TimeoutType = 5.0, + protocol: str = "https", + rest_options: RestClientOptions | None = None, + ) -> None: ... + def all( + self, + page: int | None = None, + per_page: int | None = None, + include_totals: bool = False, + extra_params: dict[str, Incomplete] | None = None, + ): ... + async def all_async( + self, + page: int | None = None, + per_page: int | None = None, + include_totals: bool = False, + extra_params: dict[str, Incomplete] | None = None, + ): ... + def delete(self, id: str): ... + async def delete_async(self, id: str): ... diff --git a/stubs/auth0-python/auth0/management/guardian.pyi b/stubs/auth0-python/auth0/management/guardian.pyi new file mode 100644 index 000000000000..19e46a0e238e --- /dev/null +++ b/stubs/auth0-python/auth0/management/guardian.pyi @@ -0,0 +1,38 @@ +from _typeshed import Incomplete + +from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions +from ..types import TimeoutType as TimeoutType + +class Guardian: + domain: Incomplete + protocol: Incomplete + client: Incomplete + def __init__( + self, + domain: str, + token: str, + telemetry: bool = True, + timeout: TimeoutType = 5.0, + protocol: str = "https", + rest_options: RestClientOptions | None = None, + ) -> None: ... + def all_factors(self) -> list[dict[str, Incomplete]]: ... + async def all_factors_async(self) -> list[dict[str, Incomplete]]: ... + def update_factor(self, name: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def update_factor_async(self, name: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + def update_templates(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def update_templates_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + def get_templates(self) -> dict[str, Incomplete]: ... + async def get_templates_async(self) -> dict[str, Incomplete]: ... + def get_enrollment(self, id: str) -> dict[str, Incomplete]: ... + async def get_enrollment_async(self, id: str) -> dict[str, Incomplete]: ... + def delete_enrollment(self, id: str): ... + async def delete_enrollment_async(self, id: str): ... + def create_enrollment_ticket(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def create_enrollment_ticket_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + def get_factor_providers(self, factor_name: str, name: str) -> dict[str, Incomplete]: ... + async def get_factor_providers_async(self, factor_name: str, name: str) -> dict[str, Incomplete]: ... + def update_factor_providers(self, factor_name: str, name: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def update_factor_providers_async( + self, factor_name: str, name: str, body: dict[str, Incomplete] + ) -> dict[str, Incomplete]: ... diff --git a/stubs/auth0-python/auth0/management/hooks.pyi b/stubs/auth0-python/auth0/management/hooks.pyi new file mode 100644 index 000000000000..37ceddff41b6 --- /dev/null +++ b/stubs/auth0-python/auth0/management/hooks.pyi @@ -0,0 +1,52 @@ +from _typeshed import Incomplete + +from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions +from ..types import TimeoutType as TimeoutType + +class Hooks: + domain: Incomplete + protocol: Incomplete + client: Incomplete + def __init__( + self, + domain: str, + token: str, + telemetry: bool = True, + timeout: TimeoutType = 5.0, + protocol: str = "https", + rest_options: RestClientOptions | None = None, + ) -> None: ... + def all( + self, + enabled: bool = True, + fields: list[str] | None = None, + include_fields: bool = True, + page: int | None = None, + per_page: int | None = None, + include_totals: bool = False, + ): ... + async def all_async( + self, + enabled: bool = True, + fields: list[str] | None = None, + include_fields: bool = True, + page: int | None = None, + per_page: int | None = None, + include_totals: bool = False, + ): ... + def create(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def create_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + def get(self, id: str, fields: list[str] | None = None) -> dict[str, Incomplete]: ... + async def get_async(self, id: str, fields: list[str] | None = None) -> dict[str, Incomplete]: ... + def delete(self, id: str): ... + async def delete_async(self, id: str): ... + def update(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def update_async(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + def get_secrets(self, id: str) -> dict[str, Incomplete]: ... + async def get_secrets_async(self, id: str) -> dict[str, Incomplete]: ... + def add_secrets(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def add_secrets_async(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + def delete_secrets(self, id: str, body: list[str]): ... + async def delete_secrets_async(self, id: str, body: list[str]): ... + def update_secrets(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def update_secrets_async(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... diff --git a/stubs/auth0-python/auth0/management/jobs.pyi b/stubs/auth0-python/auth0/management/jobs.pyi new file mode 100644 index 000000000000..7ac7699525ba --- /dev/null +++ b/stubs/auth0-python/auth0/management/jobs.pyi @@ -0,0 +1,42 @@ +from _typeshed import Incomplete + +from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions +from ..types import TimeoutType as TimeoutType + +class Jobs: + domain: Incomplete + protocol: Incomplete + client: Incomplete + def __init__( + self, + domain: str, + token: str, + telemetry: bool = True, + timeout: TimeoutType = 5.0, + protocol: str = "https", + rest_options: RestClientOptions | None = None, + ) -> None: ... + def get(self, id: str) -> dict[str, Incomplete]: ... + async def get_async(self, id: str) -> dict[str, Incomplete]: ... + def get_failed_job(self, id: str) -> dict[str, Incomplete]: ... + async def get_failed_job_async(self, id: str) -> dict[str, Incomplete]: ... + def export_users(self, body: dict[str, Incomplete]): ... + async def export_users_async(self, body: dict[str, Incomplete]): ... + def import_users( + self, + connection_id: str, + file_obj, + upsert: bool = False, + send_completion_email: bool = True, + external_id: str | None = None, + ) -> dict[str, Incomplete]: ... + async def import_users_async( + self, + connection_id: str, + file_obj, + upsert: bool = False, + send_completion_email: bool = True, + external_id: str | None = None, + ) -> dict[str, Incomplete]: ... + def send_verification_email(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def send_verification_email_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... diff --git a/stubs/auth0-python/auth0/management/log_streams.pyi b/stubs/auth0-python/auth0/management/log_streams.pyi new file mode 100644 index 000000000000..85dcd922690a --- /dev/null +++ b/stubs/auth0-python/auth0/management/log_streams.pyi @@ -0,0 +1,29 @@ +from _typeshed import Incomplete +from builtins import list as _list + +from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions +from ..types import TimeoutType as TimeoutType + +class LogStreams: + domain: Incomplete + protocol: Incomplete + client: Incomplete + def __init__( + self, + domain: str, + token: str, + telemetry: bool = True, + timeout: TimeoutType = 5.0, + protocol: str = "https", + rest_options: RestClientOptions | None = None, + ) -> None: ... + def list(self) -> _list[dict[str, Incomplete]]: ... + async def list_async(self) -> _list[dict[str, Incomplete]]: ... + def get(self, id: str) -> dict[str, Incomplete]: ... + async def get_async(self, id: str) -> dict[str, Incomplete]: ... + def create(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def create_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + def delete(self, id: str) -> dict[str, Incomplete]: ... + async def delete_async(self, id: str) -> dict[str, Incomplete]: ... + def update(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def update_async(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... diff --git a/stubs/auth0-python/auth0/management/logs.pyi b/stubs/auth0-python/auth0/management/logs.pyi new file mode 100644 index 000000000000..a5ac9e4c74b7 --- /dev/null +++ b/stubs/auth0-python/auth0/management/logs.pyi @@ -0,0 +1,44 @@ +from _typeshed import Incomplete + +from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions +from ..types import TimeoutType as TimeoutType + +class Logs: + domain: Incomplete + protocol: Incomplete + client: Incomplete + def __init__( + self, + domain: str, + token: str, + telemetry: bool = True, + timeout: TimeoutType = 5.0, + protocol: str = "https", + rest_options: RestClientOptions | None = None, + ) -> None: ... + def search( + self, + page: int = 0, + per_page: int = 50, + sort: str | None = None, + q: str | None = None, + include_totals: bool = True, + fields: list[str] | None = None, + from_param: str | None = None, + take: int | None = None, + include_fields: bool = True, + ) -> dict[str, Incomplete]: ... + async def search_async( + self, + page: int = 0, + per_page: int = 50, + sort: str | None = None, + q: str | None = None, + include_totals: bool = True, + fields: list[str] | None = None, + from_param: str | None = None, + take: int | None = None, + include_fields: bool = True, + ) -> dict[str, Incomplete]: ... + def get(self, id: str) -> dict[str, Incomplete]: ... + async def get_async(self, id: str) -> dict[str, Incomplete]: ... diff --git a/stubs/auth0-python/auth0/management/organizations.pyi b/stubs/auth0-python/auth0/management/organizations.pyi new file mode 100644 index 000000000000..9dc1205b3e43 --- /dev/null +++ b/stubs/auth0-python/auth0/management/organizations.pyi @@ -0,0 +1,134 @@ +from _typeshed import Incomplete + +from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions +from ..types import TimeoutType as TimeoutType + +class Organizations: + domain: Incomplete + protocol: Incomplete + client: Incomplete + def __init__( + self, + domain: str, + token: str, + telemetry: bool = True, + timeout: TimeoutType = 5.0, + protocol: str = "https", + rest_options: RestClientOptions | None = None, + ) -> None: ... + def all_organizations( + self, + page: int | None = None, + per_page: int | None = None, + include_totals: bool = True, + from_param: str | None = None, + take: int | None = None, + ) -> dict[str, Incomplete]: ... + async def all_organizations_async( + self, + page: int | None = None, + per_page: int | None = None, + include_totals: bool = True, + from_param: str | None = None, + take: int | None = None, + ) -> dict[str, Incomplete]: ... + def get_organization_by_name(self, name: str | None = None) -> dict[str, Incomplete]: ... + async def get_organization_by_name_async(self, name: str | None = None) -> dict[str, Incomplete]: ... + def get_organization(self, id: str) -> dict[str, Incomplete]: ... + async def get_organization_async(self, id: str) -> dict[str, Incomplete]: ... + def create_organization(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def create_organization_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + def update_organization(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def update_organization_async(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + def delete_organization(self, id: str): ... + async def delete_organization_async(self, id: str): ... + def all_organization_connections( + self, id: str, page: int | None = None, per_page: int | None = None + ) -> list[dict[str, Incomplete]]: ... + async def all_organization_connections_async( + self, id: str, page: int | None = None, per_page: int | None = None + ) -> list[dict[str, Incomplete]]: ... + def get_organization_connection(self, id: str, connection_id: str) -> dict[str, Incomplete]: ... + async def get_organization_connection_async(self, id: str, connection_id: str) -> dict[str, Incomplete]: ... + def create_organization_connection(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def create_organization_connection_async(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + def update_organization_connection( + self, id: str, connection_id: str, body: dict[str, Incomplete] + ) -> dict[str, Incomplete]: ... + async def update_organization_connection_async( + self, id: str, connection_id: str, body: dict[str, Incomplete] + ) -> dict[str, Incomplete]: ... + def delete_organization_connection(self, id: str, connection_id: str): ... + async def delete_organization_connection_async(self, id: str, connection_id: str): ... + def all_organization_members( + self, + id: str, + page: int | None = None, + per_page: int | None = None, + include_totals: bool = True, + from_param: str | None = None, + take: int | None = None, + fields: list[str] | None = None, + include_fields: bool = True, + ) -> dict[str, Incomplete]: ... + async def all_organization_members_async( + self, + id: str, + page: int | None = None, + per_page: int | None = None, + include_totals: bool = True, + from_param: str | None = None, + take: int | None = None, + fields: list[str] | None = None, + include_fields: bool = True, + ) -> dict[str, Incomplete]: ... + def create_organization_members(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def create_organization_members_async(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + def delete_organization_members(self, id: str, body: dict[str, Incomplete]): ... + async def delete_organization_members_async(self, id: str, body: dict[str, Incomplete]): ... + def all_organization_member_roles( + self, id: str, user_id: str, page: int | None = None, per_page: int | None = None, include_totals: bool = False + ) -> list[dict[str, Incomplete]]: ... + async def all_organization_member_roles_async( + self, id: str, user_id: str, page: int | None = None, per_page: int | None = None, include_totals: bool = False + ) -> list[dict[str, Incomplete]]: ... + def create_organization_member_roles(self, id: str, user_id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def create_organization_member_roles_async( + self, id: str, user_id: str, body: dict[str, Incomplete] + ) -> dict[str, Incomplete]: ... + def delete_organization_member_roles(self, id: str, user_id: str, body: dict[str, Incomplete]): ... + async def delete_organization_member_roles_async(self, id: str, user_id: str, body: dict[str, Incomplete]): ... + def all_organization_invitations( + self, id: str, page: int | None = None, per_page: int | None = None, include_totals: bool = False + ) -> dict[str, Incomplete]: ... + async def all_organization_invitations_async( + self, id: str, page: int | None = None, per_page: int | None = None, include_totals: bool = False + ) -> dict[str, Incomplete]: ... + def get_organization_invitation(self, id: str, invitaton_id: str) -> dict[str, Incomplete]: ... + async def get_organization_invitation_async(self, id: str, invitaton_id: str) -> dict[str, Incomplete]: ... + def create_organization_invitation(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def create_organization_invitation_async(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + def delete_organization_invitation(self, id: str, invitation_id: str): ... + async def delete_organization_invitation_async(self, id: str, invitation_id: str): ... + def get_client_grants( + self, + id: str, + audience: str | None = None, + client_id: str | None = None, + page: int | None = None, + per_page: int | None = None, + include_totals: bool = False, + ) -> dict[str, Incomplete]: ... + async def get_client_grants_async( + self, + id: str, + audience: str | None = None, + client_id: str | None = None, + page: int | None = None, + per_page: int | None = None, + include_totals: bool = False, + ) -> dict[str, Incomplete]: ... + def add_client_grant(self, id: str, grant_id: str) -> dict[str, Incomplete]: ... + async def add_client_grant_async(self, id: str, grant_id: str) -> dict[str, Incomplete]: ... + def delete_client_grant(self, id: str, grant_id: str) -> dict[str, Incomplete]: ... + async def delete_client_grant_async(self, id: str, grant_id: str) -> dict[str, Incomplete]: ... diff --git a/stubs/auth0-python/auth0/management/prompts.pyi b/stubs/auth0-python/auth0/management/prompts.pyi new file mode 100644 index 000000000000..37376d758e3c --- /dev/null +++ b/stubs/auth0-python/auth0/management/prompts.pyi @@ -0,0 +1,28 @@ +from _typeshed import Incomplete + +from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions +from ..types import TimeoutType as TimeoutType + +class Prompts: + domain: Incomplete + protocol: Incomplete + client: Incomplete + def __init__( + self, + domain: str, + token: str, + telemetry: bool = True, + timeout: TimeoutType = 5.0, + protocol: str = "https", + rest_options: RestClientOptions | None = None, + ) -> None: ... + def get(self) -> dict[str, Incomplete]: ... + async def get_async(self) -> dict[str, Incomplete]: ... + def update(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def update_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + def get_custom_text(self, prompt: str, language: str): ... + async def get_custom_text_async(self, prompt: str, language: str): ... + def update_custom_text(self, prompt: str, language: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def update_custom_text_async( + self, prompt: str, language: str, body: dict[str, Incomplete] + ) -> dict[str, Incomplete]: ... diff --git a/stubs/auth0-python/auth0/management/resource_servers.pyi b/stubs/auth0-python/auth0/management/resource_servers.pyi new file mode 100644 index 000000000000..8e6ca07b0b9d --- /dev/null +++ b/stubs/auth0-python/auth0/management/resource_servers.pyi @@ -0,0 +1,28 @@ +from _typeshed import Incomplete + +from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions +from ..types import TimeoutType as TimeoutType + +class ResourceServers: + domain: Incomplete + protocol: Incomplete + client: Incomplete + def __init__( + self, + domain: str, + token: str, + telemetry: bool = True, + timeout: TimeoutType = 5.0, + protocol: str = "https", + rest_options: RestClientOptions | None = None, + ) -> None: ... + def create(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def create_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + def get_all(self, page: int | None = None, per_page: int | None = None, include_totals: bool = False): ... + async def get_all_async(self, page: int | None = None, per_page: int | None = None, include_totals: bool = False): ... + def get(self, id: str) -> dict[str, Incomplete]: ... + async def get_async(self, id: str) -> dict[str, Incomplete]: ... + def delete(self, id: str): ... + async def delete_async(self, id: str): ... + def update(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def update_async(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... diff --git a/stubs/auth0-python/auth0/management/roles.pyi b/stubs/auth0-python/auth0/management/roles.pyi new file mode 100644 index 000000000000..1cb8b1ff9b34 --- /dev/null +++ b/stubs/auth0-python/auth0/management/roles.pyi @@ -0,0 +1,63 @@ +from _typeshed import Incomplete +from builtins import list as _list + +from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions +from ..types import TimeoutType as TimeoutType + +class Roles: + domain: Incomplete + protocol: Incomplete + client: Incomplete + def __init__( + self, + domain: str, + token: str, + telemetry: bool = True, + timeout: TimeoutType = 5.0, + protocol: str = "https", + rest_options: RestClientOptions | None = None, + ) -> None: ... + def list( + self, page: int = 0, per_page: int = 25, include_totals: bool = True, name_filter: str | None = None + ) -> dict[str, Incomplete]: ... + async def list_async( + self, page: int = 0, per_page: int = 25, include_totals: bool = True, name_filter: str | None = None + ) -> dict[str, Incomplete]: ... + def create(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def create_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + def get(self, id: str) -> dict[str, Incomplete]: ... + async def get_async(self, id: str) -> dict[str, Incomplete]: ... + def delete(self, id: str): ... + async def delete_async(self, id: str): ... + def update(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def update_async(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + def list_users( + self, + id: str, + page: int = 0, + per_page: int = 25, + include_totals: bool = True, + from_param: str | None = None, + take: int | None = None, + ) -> dict[str, Incomplete]: ... + async def list_users_async( + self, + id: str, + page: int = 0, + per_page: int = 25, + include_totals: bool = True, + from_param: str | None = None, + take: int | None = None, + ) -> dict[str, Incomplete]: ... + def add_users(self, id: str, users: _list[str]) -> dict[str, Incomplete]: ... + async def add_users_async(self, id: str, users: _list[str]) -> dict[str, Incomplete]: ... + def list_permissions( + self, id: str, page: int = 0, per_page: int = 25, include_totals: bool = True + ) -> dict[str, Incomplete]: ... + async def list_permissions_async( + self, id: str, page: int = 0, per_page: int = 25, include_totals: bool = True + ) -> dict[str, Incomplete]: ... + def remove_permissions(self, id: str, permissions: _list[dict[str, str]]): ... + async def remove_permissions_async(self, id: str, permissions: _list[dict[str, str]]): ... + def add_permissions(self, id: str, permissions: _list[dict[str, str]]) -> dict[str, Incomplete]: ... + async def add_permissions_async(self, id: str, permissions: _list[dict[str, str]]) -> dict[str, Incomplete]: ... diff --git a/stubs/auth0-python/auth0/management/rules.pyi b/stubs/auth0-python/auth0/management/rules.pyi new file mode 100644 index 000000000000..1eac99eb60f7 --- /dev/null +++ b/stubs/auth0-python/auth0/management/rules.pyi @@ -0,0 +1,46 @@ +from _typeshed import Incomplete + +from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions +from ..types import TimeoutType as TimeoutType + +class Rules: + domain: Incomplete + protocol: Incomplete + client: Incomplete + def __init__( + self, + domain: str, + token: str, + telemetry: bool = True, + timeout: TimeoutType = 5.0, + protocol: str = "https", + rest_options: RestClientOptions | None = None, + ) -> None: ... + def all( + self, + stage: str = "login_success", + enabled: bool = True, + fields: list[str] | None = None, + include_fields: bool = True, + page: int | None = None, + per_page: int | None = None, + include_totals: bool = False, + ) -> dict[str, Incomplete]: ... + async def all_async( + self, + stage: str = "login_success", + enabled: bool = True, + fields: list[str] | None = None, + include_fields: bool = True, + page: int | None = None, + per_page: int | None = None, + include_totals: bool = False, + ) -> dict[str, Incomplete]: ... + def create(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def create_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + def get(self, id: str, fields: list[str] | None = None, include_fields: bool = True) -> dict[str, Incomplete]: ... + async def get_async(self, id: str, fields: list[str] | None = None, include_fields: bool = True) -> dict[str, Incomplete]: ... + def delete(self, id: str): ... + async def delete_async(self, id: str): ... + def update(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def update_async(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... diff --git a/stubs/auth0-python/auth0/management/rules_configs.pyi b/stubs/auth0-python/auth0/management/rules_configs.pyi new file mode 100644 index 000000000000..f276a18d9a36 --- /dev/null +++ b/stubs/auth0-python/auth0/management/rules_configs.pyi @@ -0,0 +1,24 @@ +from _typeshed import Incomplete + +from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions +from ..types import TimeoutType as TimeoutType + +class RulesConfigs: + domain: Incomplete + protocol: Incomplete + client: Incomplete + def __init__( + self, + domain: str, + token: str, + telemetry: bool = True, + timeout: TimeoutType = 5.0, + protocol: str = "https", + rest_options: RestClientOptions | None = None, + ) -> None: ... + def all(self) -> list[dict[str, Incomplete]]: ... + async def all_async(self) -> list[dict[str, Incomplete]]: ... + def unset(self, key: str): ... + async def unset_async(self, key: str): ... + def set(self, key: str, value: str) -> dict[str, Incomplete]: ... + async def set_async(self, key: str, value: str) -> dict[str, Incomplete]: ... diff --git a/stubs/auth0-python/auth0/management/stats.pyi b/stubs/auth0-python/auth0/management/stats.pyi new file mode 100644 index 000000000000..f3128be12eaf --- /dev/null +++ b/stubs/auth0-python/auth0/management/stats.pyi @@ -0,0 +1,24 @@ +from _typeshed import Incomplete + +from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions +from ..types import TimeoutType as TimeoutType + +class Stats: + domain: Incomplete + protocol: Incomplete + client: Incomplete + def __init__( + self, + domain: str, + token: str, + telemetry: bool = True, + timeout: TimeoutType = 5.0, + protocol: str = "https", + rest_options: RestClientOptions | None = None, + ) -> None: ... + def active_users(self) -> int: ... + async def active_users_async(self) -> int: ... + def daily_stats(self, from_date: str | None = None, to_date: str | None = None) -> list[dict[str, Incomplete]]: ... + async def daily_stats_async( + self, from_date: str | None = None, to_date: str | None = None + ) -> list[dict[str, Incomplete]]: ... diff --git a/stubs/auth0-python/auth0/management/tenants.pyi b/stubs/auth0-python/auth0/management/tenants.pyi new file mode 100644 index 000000000000..12a4df7ad40a --- /dev/null +++ b/stubs/auth0-python/auth0/management/tenants.pyi @@ -0,0 +1,22 @@ +from _typeshed import Incomplete + +from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions +from ..types import TimeoutType as TimeoutType + +class Tenants: + domain: Incomplete + protocol: Incomplete + client: Incomplete + def __init__( + self, + domain: str, + token: str, + telemetry: bool = True, + timeout: TimeoutType = 5.0, + protocol: str = "https", + rest_options: RestClientOptions | None = None, + ) -> None: ... + def get(self, fields: list[str] | None = None, include_fields: bool = True) -> dict[str, Incomplete]: ... + async def get_async(self, fields: list[str] | None = None, include_fields: bool = True) -> dict[str, Incomplete]: ... + def update(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def update_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... diff --git a/stubs/auth0-python/auth0/management/tickets.pyi b/stubs/auth0-python/auth0/management/tickets.pyi new file mode 100644 index 000000000000..236596687f29 --- /dev/null +++ b/stubs/auth0-python/auth0/management/tickets.pyi @@ -0,0 +1,22 @@ +from _typeshed import Incomplete + +from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions +from ..types import TimeoutType as TimeoutType + +class Tickets: + domain: Incomplete + protocol: Incomplete + client: Incomplete + def __init__( + self, + domain: str, + token: str, + telemetry: bool = True, + timeout: TimeoutType = 5.0, + protocol: str = "https", + rest_options: RestClientOptions | None = None, + ) -> None: ... + def create_email_verification(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def create_email_verification_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + def create_pswd_change(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def create_pswd_change_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... diff --git a/stubs/auth0-python/auth0/management/user_blocks.pyi b/stubs/auth0-python/auth0/management/user_blocks.pyi new file mode 100644 index 000000000000..7417dd514e59 --- /dev/null +++ b/stubs/auth0-python/auth0/management/user_blocks.pyi @@ -0,0 +1,26 @@ +from _typeshed import Incomplete + +from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions +from ..types import TimeoutType as TimeoutType + +class UserBlocks: + domain: Incomplete + protocol: Incomplete + client: Incomplete + def __init__( + self, + domain: str, + token: str, + telemetry: bool = True, + timeout: TimeoutType = 5.0, + protocol: str = "https", + rest_options: RestClientOptions | None = None, + ) -> None: ... + def get_by_identifier(self, identifier: str) -> dict[str, Incomplete]: ... + async def get_by_identifier_async(self, identifier: str) -> dict[str, Incomplete]: ... + def unblock_by_identifier(self, identifier: dict[str, Incomplete]): ... + async def unblock_by_identifier_async(self, identifier: dict[str, Incomplete]): ... + def get(self, id: str) -> dict[str, Incomplete]: ... + async def get_async(self, id: str) -> dict[str, Incomplete]: ... + def unblock(self, id: str): ... + async def unblock_async(self, id: str): ... diff --git a/stubs/auth0-python/auth0/management/users.pyi b/stubs/auth0-python/auth0/management/users.pyi new file mode 100644 index 000000000000..e2e159b5755f --- /dev/null +++ b/stubs/auth0-python/auth0/management/users.pyi @@ -0,0 +1,119 @@ +from _typeshed import Incomplete +from builtins import list as _list + +from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions +from ..types import TimeoutType as TimeoutType + +class Users: + domain: Incomplete + protocol: Incomplete + client: Incomplete + def __init__( + self, + domain: str, + token: str, + telemetry: bool = True, + timeout: TimeoutType = 5.0, + protocol: str = "https", + rest_options: RestClientOptions | None = None, + ) -> None: ... + def list( + self, + page: int = 0, + per_page: int = 25, + sort: str | None = None, + connection: str | None = None, + q: str | None = None, + search_engine: str | None = None, + include_totals: bool = True, + fields: _list[str] | None = None, + include_fields: bool = True, + ) -> dict[str, Incomplete]: ... + async def list_async( + self, + page: int = 0, + per_page: int = 25, + sort: str | None = None, + connection: str | None = None, + q: str | None = None, + search_engine: str | None = None, + include_totals: bool = True, + fields: _list[str] | None = None, + include_fields: bool = True, + ) -> dict[str, Incomplete]: ... + def create(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def create_async(self, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + def get(self, id: str, fields: _list[str] | None = None, include_fields: bool = True) -> dict[str, Incomplete]: ... + async def get_async( + self, id: str, fields: _list[str] | None = None, include_fields: bool = True + ) -> dict[str, Incomplete]: ... + def delete(self, id: str): ... + async def delete_async(self, id: str): ... + def update(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def update_async(self, id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + def list_organizations( + self, id: str, page: int = 0, per_page: int = 25, include_totals: bool = True + ) -> dict[str, Incomplete]: ... + async def list_organizations_async( + self, id: str, page: int = 0, per_page: int = 25, include_totals: bool = True + ) -> dict[str, Incomplete]: ... + def list_roles(self, id: str, page: int = 0, per_page: int = 25, include_totals: bool = True) -> dict[str, Incomplete]: ... + async def list_roles_async( + self, id: str, page: int = 0, per_page: int = 25, include_totals: bool = True + ) -> dict[str, Incomplete]: ... + def remove_roles(self, id: str, roles: _list[str]): ... + async def remove_roles_async(self, id: str, roles: _list[str]): ... + def add_roles(self, id: str, roles: _list[str]) -> dict[str, Incomplete]: ... + async def add_roles_async(self, id: str, roles: _list[str]) -> dict[str, Incomplete]: ... + def list_permissions( + self, id: str, page: int = 0, per_page: int = 25, include_totals: bool = True + ) -> dict[str, Incomplete]: ... + async def list_permissions_async( + self, id: str, page: int = 0, per_page: int = 25, include_totals: bool = True + ) -> dict[str, Incomplete]: ... + def remove_permissions(self, id: str, permissions: _list[str]): ... + async def remove_permissions_async(self, id: str, permissions: _list[str]): ... + def add_permissions(self, id: str, permissions: _list[str]) -> dict[str, Incomplete]: ... + async def add_permissions_async(self, id: str, permissions: _list[str]) -> dict[str, Incomplete]: ... + def delete_multifactor(self, id: str, provider: str): ... + async def delete_multifactor_async(self, id: str, provider: str): ... + def delete_authenticators(self, id: str): ... + async def delete_authenticators_async(self, id: str): ... + def unlink_user_account(self, id: str, provider: str, user_id: str): ... + async def unlink_user_account_async(self, id: str, provider: str, user_id: str): ... + def link_user_account(self, user_id: str, body: dict[str, Incomplete]) -> _list[dict[str, Incomplete]]: ... + async def link_user_account_async(self, user_id: str, body: dict[str, Incomplete]) -> _list[dict[str, Incomplete]]: ... + def regenerate_recovery_code(self, user_id: str) -> dict[str, Incomplete]: ... + async def regenerate_recovery_code_async(self, user_id: str) -> dict[str, Incomplete]: ... + def get_guardian_enrollments(self, user_id: str) -> dict[str, Incomplete]: ... + async def get_guardian_enrollments_async(self, user_id: str) -> dict[str, Incomplete]: ... + def get_log_events( + self, user_id: str, page: int = 0, per_page: int = 50, sort: str | None = None, include_totals: bool = False + ) -> dict[str, Incomplete]: ... + async def get_log_events_async( + self, user_id: str, page: int = 0, per_page: int = 50, sort: str | None = None, include_totals: bool = False + ) -> dict[str, Incomplete]: ... + def invalidate_remembered_browsers(self, user_id: str) -> dict[str, Incomplete]: ... + async def invalidate_remembered_browsers_async(self, user_id: str) -> dict[str, Incomplete]: ... + def get_authentication_methods(self, user_id: str) -> dict[str, Incomplete]: ... + async def get_authentication_methods_async(self, user_id: str) -> dict[str, Incomplete]: ... + def get_authentication_method_by_id(self, user_id: str, authentication_method_id: str) -> dict[str, Incomplete]: ... + async def get_authentication_method_by_id_async( + self, user_id: str, authentication_method_id: str + ) -> dict[str, Incomplete]: ... + def create_authentication_method(self, user_id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def create_authentication_method_async(self, user_id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + def update_authentication_methods(self, user_id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + async def update_authentication_methods_async(self, user_id: str, body: dict[str, Incomplete]) -> dict[str, Incomplete]: ... + def update_authentication_method_by_id( + self, user_id: str, authentication_method_id: str, body: dict[str, Incomplete] + ) -> dict[str, Incomplete]: ... + async def update_authentication_method_by_id_async( + self, user_id: str, authentication_method_id: str, body: dict[str, Incomplete] + ) -> dict[str, Incomplete]: ... + def delete_authentication_methods(self, user_id: str): ... + async def delete_authentication_methods_async(self, user_id: str): ... + def delete_authentication_method_by_id(self, user_id: str, authentication_method_id: str): ... + async def delete_authentication_method_by_id_async(self, user_id: str, authentication_method_id: str): ... + def list_tokensets(self, id: str, page: int = 0, per_page: int = 25, include_totals: bool = True): ... + def delete_tokenset_by_id(self, user_id: str, tokenset_id: str): ... diff --git a/stubs/auth0-python/auth0/management/users_by_email.pyi b/stubs/auth0-python/auth0/management/users_by_email.pyi new file mode 100644 index 000000000000..177fe7b092bf --- /dev/null +++ b/stubs/auth0-python/auth0/management/users_by_email.pyi @@ -0,0 +1,24 @@ +from _typeshed import Incomplete + +from ..rest import RestClient as RestClient, RestClientOptions as RestClientOptions +from ..types import TimeoutType as TimeoutType + +class UsersByEmail: + domain: Incomplete + protocol: Incomplete + client: Incomplete + def __init__( + self, + domain: str, + token: str, + telemetry: bool = True, + timeout: TimeoutType = 5.0, + protocol: str = "https", + rest_options: RestClientOptions | None = None, + ) -> None: ... + def search_users_by_email( + self, email: str, fields: list[str] | None = None, include_fields: bool = True + ) -> list[dict[str, Incomplete]]: ... + async def search_users_by_email_async( + self, email: str, fields: list[str] | None = None, include_fields: bool = True + ) -> list[dict[str, Incomplete]]: ... diff --git a/stubs/auth0-python/auth0/rest.pyi b/stubs/auth0-python/auth0/rest.pyi new file mode 100644 index 000000000000..5b12d48e7713 --- /dev/null +++ b/stubs/auth0-python/auth0/rest.pyi @@ -0,0 +1,49 @@ +from _typeshed import Incomplete +from collections.abc import Mapping +from typing import Final + +import requests +from auth0.exceptions import Auth0Error as Auth0Error, RateLimitError as RateLimitError +from auth0.rest_async import RequestsResponse as RequestsResponse +from auth0.types import RequestData as RequestData, TimeoutType as TimeoutType + +UNKNOWN_ERROR: Final[str] + +class RestClientOptions: + telemetry: bool + timeout: TimeoutType + retries: int + def __init__(self, telemetry: bool = True, timeout: TimeoutType = 5.0, retries: int = 3) -> None: ... + +class RestClient: + options: RestClientOptions + jwt: str | None + base_headers: dict[str, str] + telemetry: bool + timeout: TimeoutType + def __init__( + self, jwt: str | None, telemetry: bool = True, timeout: TimeoutType = 5.0, options: RestClientOptions | None = None + ) -> None: ... + def MAX_REQUEST_RETRIES(self) -> int: ... + def MAX_REQUEST_RETRY_JITTER(self) -> int: ... + def MAX_REQUEST_RETRY_DELAY(self) -> int: ... + def MIN_REQUEST_RETRY_DELAY(self) -> int: ... + def get(self, url: str, params: dict[str, Incomplete] | None = None, headers: dict[str, str] | None = None): ... + def post(self, url: str, data: RequestData | None = None, headers: dict[str, str] | None = None): ... + def file_post(self, url: str, data: RequestData | None = None, files: dict[str, Incomplete] | None = None): ... + def patch(self, url: str, data: RequestData | None = None): ... + def put(self, url: str, data: RequestData | None = None): ... + def delete(self, url: str, params: dict[str, Incomplete] | None = None, data: RequestData | None = None): ... + +class Response: + def __init__(self, status_code: int, content, headers: Mapping[str, str]) -> None: ... + def content(self): ... + +class JsonResponse(Response): + def __init__(self, response: requests.Response | RequestsResponse) -> None: ... + +class PlainResponse(Response): + def __init__(self, response: requests.Response | RequestsResponse) -> None: ... + +class EmptyResponse(Response): + def __init__(self, status_code: int) -> None: ... diff --git a/stubs/auth0-python/auth0/rest_async.pyi b/stubs/auth0-python/auth0/rest_async.pyi new file mode 100644 index 000000000000..fec31cd6c515 --- /dev/null +++ b/stubs/auth0-python/auth0/rest_async.pyi @@ -0,0 +1,28 @@ +from _typeshed import Incomplete + +from auth0.exceptions import RateLimitError as RateLimitError +from auth0.types import RequestData as RequestData + +from .rest import ( + EmptyResponse as EmptyResponse, + JsonResponse as JsonResponse, + PlainResponse as PlainResponse, + Response as Response, + RestClient as RestClient, +) + +class AsyncRestClient(RestClient): + timeout: Incomplete + def set_session(self, session) -> None: ... + async def get(self, url: str, params: dict[str, Incomplete] | None = None, headers: dict[str, str] | None = None): ... + async def post(self, url: str, data: RequestData | None = None, headers: dict[str, str] | None = None): ... + async def file_post(self, *args, **kwargs): ... + async def patch(self, url: str, data: RequestData | None = None): ... + async def put(self, url: str, data: RequestData | None = None): ... + async def delete(self, url: str, params: dict[str, Incomplete] | None = None, data: RequestData | None = None): ... + +class RequestsResponse: + status_code: int + headers: Incomplete + text: str + def __init__(self, response, text: str) -> None: ... diff --git a/stubs/auth0-python/auth0/types.pyi b/stubs/auth0-python/auth0/types.pyi new file mode 100644 index 000000000000..385643dc72d0 --- /dev/null +++ b/stubs/auth0-python/auth0/types.pyi @@ -0,0 +1,5 @@ +from _typeshed import Incomplete +from typing_extensions import TypeAlias + +TimeoutType: TypeAlias = float | tuple[float, float] +RequestData: TypeAlias = dict[str, Incomplete] | list[Incomplete] diff --git a/stubs/auth0-python/auth0/utils.pyi b/stubs/auth0-python/auth0/utils.pyi new file mode 100644 index 000000000000..611cd037c258 --- /dev/null +++ b/stubs/auth0-python/auth0/utils.pyi @@ -0,0 +1 @@ +def is_async_available() -> bool: ... From fe5444b6d29ef5a989425bc0b908f52cb867aa5f Mon Sep 17 00:00:00 2001 From: Avasam Date: Mon, 14 Apr 2025 16:01:36 -0400 Subject: [PATCH 08/12] Discard changes to stubs/auth0-python/auth0/__init__.pyi --- stubs/auth0-python/auth0/__init__.pyi | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 stubs/auth0-python/auth0/__init__.pyi diff --git a/stubs/auth0-python/auth0/__init__.pyi b/stubs/auth0-python/auth0/__init__.pyi new file mode 100644 index 000000000000..3dfa028c921c --- /dev/null +++ b/stubs/auth0-python/auth0/__init__.pyi @@ -0,0 +1,7 @@ +from auth0.exceptions import ( + Auth0Error as Auth0Error, + RateLimitError as RateLimitError, + TokenValidationError as TokenValidationError, +) + +__all__ = ("Auth0Error", "RateLimitError", "TokenValidationError") From 989d484eadf82bd81289b3e1cf74635849f485d5 Mon Sep 17 00:00:00 2001 From: Avasam Date: Mon, 14 Apr 2025 16:03:43 -0400 Subject: [PATCH 09/12] Discard changes to stubs/auth0-python/METADATA.toml --- stubs/auth0-python/METADATA.toml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/stubs/auth0-python/METADATA.toml b/stubs/auth0-python/METADATA.toml index 7474e9533ef2..8ef32734a656 100644 --- a/stubs/auth0-python/METADATA.toml +++ b/stubs/auth0-python/METADATA.toml @@ -1,10 +1,3 @@ version = "4.9.*" upstream_repository = "https://github.com/auth0/auth0-python" -requires = ["aiohttp", "auth0-python", "cryptography"] -# Inline typing of the library is complete, but it's missing dynamically generated _async methods and subclasses, which we generate -partial_stub = true - -# When ran directly on our stubs, mypy won't understand that they are partial -[mypy-tests.auth0] -module_name = "auth0.*" -values = { "follow_untyped_imports" = true } +requires = ["cryptography", "types-requests"] From 6c071a9d0f4a2f542687eae444dee18c6f68f766 Mon Sep 17 00:00:00 2001 From: Avasam Date: Mon, 14 Apr 2025 16:06:58 -0400 Subject: [PATCH 10/12] Discard changes to lib/ts_utils/metadata.py --- lib/ts_utils/metadata.py | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/ts_utils/metadata.py b/lib/ts_utils/metadata.py index ec30f9301425..f851ce536519 100644 --- a/lib/ts_utils/metadata.py +++ b/lib/ts_utils/metadata.py @@ -166,7 +166,6 @@ def is_obsolete(self) -> bool: "tool", "partial_stub", "requires_python", - "mypy-tests", } ) _KNOWN_METADATA_TOOL_FIELDS: Final = { From 1db3ed44f2b31ab56adff9b8db371b02a616abbd Mon Sep 17 00:00:00 2001 From: Avasam Date: Mon, 14 Apr 2025 16:07:14 -0400 Subject: [PATCH 11/12] Discard changes to stubs/auth0-python/@tests/stubtest_allowlist.txt --- .../@tests/stubtest_allowlist.txt | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/stubs/auth0-python/@tests/stubtest_allowlist.txt b/stubs/auth0-python/@tests/stubtest_allowlist.txt index 341173a08980..8264245ada21 100644 --- a/stubs/auth0-python/@tests/stubtest_allowlist.txt +++ b/stubs/auth0-python/@tests/stubtest_allowlist.txt @@ -1,17 +1,17 @@ # Omit tests auth0\.test.* -# # Omit _async functions because they aren't present in the code -# auth0\..*_async +# Omit _async functions because they aren't present in the code +auth0\..*_async -# # Inconsistently implemented, ommitted -# auth0.asyncify.AsyncRestClient.file_post -# auth0.authentication.async_token_verifier.AsyncRestClient.file_post -# auth0.management.Auth0\..* -# auth0.rest_async.AsyncRestClient.file_post -# auth0.authentication.async_token_verifier.AsyncTokenVerifier.verify +# Inconsistently implemented, ommitted +auth0.asyncify.AsyncRestClient.file_post +auth0.authentication.async_token_verifier.AsyncRestClient.file_post +auth0.management.Auth0\..* +auth0.rest_async.AsyncRestClient.file_post +auth0.authentication.async_token_verifier.AsyncTokenVerifier.verify -# # TYPE_CHECKING override makes these show up wrong -# auth0.management.async_auth0.RestClientOptions -# auth0.management.auth0.RestClientOptions -# auth0.rest.RequestsResponse +# TYPE_CHECKING override makes these show up wrong +auth0.management.async_auth0.RestClientOptions +auth0.management.auth0.RestClientOptions +auth0.rest.RequestsResponse From ad9e6d4c8094de75965998b183988eeba91fdd11 Mon Sep 17 00:00:00 2001 From: Avasam Date: Mon, 14 Apr 2025 16:08:51 -0400 Subject: [PATCH 12/12] Remove aiohttp import --- stubs/auth0-python/auth0/management/async_auth0.pyi | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/stubs/auth0-python/auth0/management/async_auth0.pyi b/stubs/auth0-python/auth0/management/async_auth0.pyi index b4d4b37999f5..89b171a45374 100644 --- a/stubs/auth0-python/auth0/management/async_auth0.pyi +++ b/stubs/auth0-python/auth0/management/async_auth0.pyi @@ -1,7 +1,6 @@ from types import TracebackType from typing_extensions import Self -import aiohttp from auth0.rest import RestClientOptions # ignore: Relative import climbs too many namespaces @@ -38,7 +37,7 @@ from .._asyncified.management.users_by_email import _UsersByEmailAsync # type: class AsyncAuth0: def __init__(self, domain: str, token: str, rest_options: RestClientOptions | None = None) -> None: ... - def set_session(self, session: aiohttp.ClientSession) -> None: ... + def set_session(self, session) -> None: ... async def __aenter__(self) -> Self: ... async def __aexit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None