workos 1.13.0__py3-none-any.whl → 5.38.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- workos/__about__.py +1 -1
- workos/__init__.py +3 -7
- workos/_base_client.py +138 -0
- workos/_client_configuration.py +10 -0
- workos/api_keys.py +53 -0
- workos/async_client.py +144 -0
- workos/audit_logs.py +125 -0
- workos/client.py +105 -20
- workos/directory_sync.py +369 -146
- workos/events.py +111 -0
- workos/exceptions.py +53 -26
- workos/fga.py +649 -0
- workos/mfa.py +152 -116
- workos/organization_domains.py +179 -0
- workos/organizations.py +401 -86
- workos/passwordless.py +67 -43
- workos/pipes.py +93 -0
- workos/portal.py +51 -28
- workos/session.py +337 -0
- workos/sso.py +305 -149
- workos/types/__init__.py +4 -0
- workos/types/api_keys/__init__.py +1 -0
- workos/types/api_keys/api_keys.py +20 -0
- workos/types/audit_logs/__init__.py +6 -0
- workos/types/audit_logs/audit_log_event.py +16 -0
- workos/types/audit_logs/audit_log_event_actor.py +12 -0
- workos/types/audit_logs/audit_log_event_context.py +8 -0
- workos/types/audit_logs/audit_log_event_target.py +12 -0
- workos/types/audit_logs/audit_log_export.py +18 -0
- workos/types/audit_logs/audit_log_metadata.py +4 -0
- workos/types/directory_sync/__init__.py +5 -0
- workos/types/directory_sync/directory.py +31 -0
- workos/types/directory_sync/directory_group.py +16 -0
- workos/types/directory_sync/directory_state.py +28 -0
- workos/types/directory_sync/directory_type.py +24 -0
- workos/types/directory_sync/directory_user.py +50 -0
- workos/types/directory_sync/list_filters.py +21 -0
- workos/types/events/__init__.py +13 -0
- workos/types/events/authentication_payload.py +70 -0
- workos/types/events/connection_payload_with_legacy_fields.py +5 -0
- workos/types/events/directory_group_membership_payload.py +9 -0
- workos/types/events/directory_group_with_previous_attributes.py +6 -0
- workos/types/events/directory_payload.py +16 -0
- workos/types/events/directory_payload_with_legacy_fields.py +29 -0
- workos/types/events/directory_user_with_previous_attributes.py +6 -0
- workos/types/events/event.py +324 -0
- workos/types/events/event_model.py +103 -0
- workos/types/events/event_type.py +59 -0
- workos/types/events/list_filters.py +10 -0
- workos/types/events/organization_domain_verification_failed_payload.py +14 -0
- workos/types/events/previous_attributes.py +3 -0
- workos/types/events/session_payload.py +27 -0
- workos/types/feature_flags/__init__.py +3 -0
- workos/types/feature_flags/feature_flag.py +12 -0
- workos/types/feature_flags/list_filters.py +5 -0
- workos/types/fga/__init__.py +5 -0
- workos/types/fga/authorization_resource_types.py +9 -0
- workos/types/fga/authorization_resources.py +10 -0
- workos/types/fga/check.py +51 -0
- workos/types/fga/list_filters.py +24 -0
- workos/types/fga/warnings.py +33 -0
- workos/types/fga/warrant.py +49 -0
- workos/types/list_resource.py +198 -0
- workos/types/metadata.py +4 -0
- workos/types/mfa/__init__.py +5 -0
- workos/types/mfa/authentication_challenge.py +14 -0
- workos/types/mfa/authentication_challenge_verification_response.py +9 -0
- workos/types/mfa/authentication_factor.py +70 -0
- workos/types/mfa/authentication_factor_totp_and_challenge_response.py +10 -0
- workos/types/mfa/enroll_authentication_factor_type.py +8 -0
- workos/types/organization_domains/__init__.py +1 -0
- workos/types/organization_domains/organization_domain.py +18 -0
- workos/types/organizations/__init__.py +6 -0
- workos/types/organizations/domain_data_input.py +7 -0
- workos/types/organizations/list_filters.py +6 -0
- workos/types/organizations/organization.py +13 -0
- workos/types/organizations/organization_common.py +12 -0
- workos/types/passwordless/__init__.py +2 -0
- workos/types/passwordless/passwordless_session.py +12 -0
- workos/types/passwordless/passwordless_session_type.py +3 -0
- workos/types/pipes/__init__.py +6 -0
- workos/types/pipes/pipes.py +34 -0
- workos/types/portal/__init__.py +2 -0
- workos/types/portal/portal_link.py +7 -0
- workos/types/portal/portal_link_intent.py +11 -0
- workos/types/portal/portal_link_intent_options.py +9 -0
- workos/types/roles/__init__.py +0 -0
- workos/types/roles/role.py +27 -0
- workos/types/sso/__init__.py +4 -0
- workos/types/sso/connection.py +70 -0
- workos/types/sso/connection_domain.py +8 -0
- workos/types/sso/profile.py +35 -0
- workos/types/sso/sso_provider_type.py +10 -0
- workos/types/user_management/__init__.py +12 -0
- workos/types/user_management/authenticate_with_common.py +66 -0
- workos/types/user_management/authentication_response.py +53 -0
- workos/types/user_management/email_verification.py +18 -0
- workos/types/user_management/impersonator.py +8 -0
- workos/types/user_management/invitation.py +26 -0
- workos/types/user_management/list_filters.py +29 -0
- workos/types/user_management/magic_auth.py +18 -0
- workos/types/user_management/oauth_tokens.py +21 -0
- workos/types/user_management/organization_membership.py +25 -0
- workos/types/user_management/password_hash_type.py +4 -0
- workos/types/user_management/password_reset.py +18 -0
- workos/types/user_management/screen_hint.py +3 -0
- workos/types/user_management/session.py +79 -0
- workos/types/user_management/user.py +22 -0
- workos/types/user_management/user_management_provider_type.py +11 -0
- workos/types/vault/__init__.py +2 -0
- workos/types/vault/key.py +25 -0
- workos/types/vault/object.py +38 -0
- workos/types/webhooks/__init__.py +0 -0
- workos/types/webhooks/webhook.py +330 -0
- workos/types/webhooks/webhook_model.py +14 -0
- workos/types/webhooks/webhook_payload.py +4 -0
- workos/types/widgets/__init__.py +2 -0
- workos/types/widgets/widget_scope.py +4 -0
- workos/types/widgets/widget_token_response.py +7 -0
- workos/types/workos_model.py +26 -0
- workos/typing/__init__.py +1 -0
- workos/typing/literals.py +32 -0
- workos/typing/sync_or_async.py +5 -0
- workos/typing/untyped_literal.py +37 -0
- workos/typing/webhooks.py +18 -0
- workos/user_management.py +2400 -0
- workos/utils/_base_http_client.py +252 -0
- workos/utils/crypto_provider.py +39 -0
- workos/utils/http_client.py +214 -0
- workos/utils/pagination_order.py +4 -0
- workos/utils/request_helper.py +27 -0
- workos/vault.py +544 -0
- workos/webhooks.py +96 -39
- workos/widgets.py +55 -0
- {workos-1.13.0.dist-info → workos-5.38.0.dist-info}/LICENSE +1 -1
- {workos-1.13.0.dist-info → workos-5.38.0.dist-info}/METADATA +47 -22
- workos-5.38.0.dist-info/RECORD +141 -0
- {workos-1.13.0.dist-info → workos-5.38.0.dist-info}/WHEEL +1 -1
- workos/audit_trail.py +0 -179
- workos/resources/base.py +0 -36
- workos/resources/directory_sync.py +0 -28
- workos/resources/event.py +0 -42
- workos/resources/event_action.py +0 -11
- workos/resources/mfa.py +0 -32
- workos/resources/sso.py +0 -53
- workos/utils/connection_types.py +0 -35
- workos/utils/pagiantion_order.py +0 -6
- workos/utils/request.py +0 -100
- workos/utils/validation.py +0 -60
- workos-1.13.0.dist-info/RECORD +0 -29
- /workos/{resources/__init__.py → py.typed} +0 -0
- {workos-1.13.0.dist-info → workos-5.38.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
from typing import Literal, Optional
|
|
2
|
+
from workos.types.workos_model import WorkOSModel
|
|
3
|
+
from workos.types.directory_sync.directory_state import DirectoryState
|
|
4
|
+
from workos.types.directory_sync.directory_type import DirectoryType
|
|
5
|
+
from workos.typing.literals import LiteralOrUntyped
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class DirectoryUsersMetadata(WorkOSModel):
|
|
9
|
+
active: int
|
|
10
|
+
inactive: int
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class DirectoryMetadata(WorkOSModel):
|
|
14
|
+
users: DirectoryUsersMetadata
|
|
15
|
+
groups: int
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class Directory(WorkOSModel):
|
|
19
|
+
"""Representation of a Directory Response as returned by WorkOS through the Directory Sync feature."""
|
|
20
|
+
|
|
21
|
+
id: str
|
|
22
|
+
object: Literal["directory"]
|
|
23
|
+
domain: Optional[str] = None
|
|
24
|
+
name: str
|
|
25
|
+
organization_id: str
|
|
26
|
+
external_key: str
|
|
27
|
+
state: LiteralOrUntyped[DirectoryState]
|
|
28
|
+
type: LiteralOrUntyped[DirectoryType]
|
|
29
|
+
metadata: Optional[DirectoryMetadata] = None
|
|
30
|
+
created_at: str
|
|
31
|
+
updated_at: str
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from typing import Any, Literal, Mapping
|
|
2
|
+
from workos.types.workos_model import WorkOSModel
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class DirectoryGroup(WorkOSModel):
|
|
6
|
+
"""Representation of a Directory Group as returned by WorkOS through the Directory Sync feature."""
|
|
7
|
+
|
|
8
|
+
id: str
|
|
9
|
+
object: Literal["directory_group"]
|
|
10
|
+
idp_id: str
|
|
11
|
+
name: str
|
|
12
|
+
directory_id: str
|
|
13
|
+
organization_id: str
|
|
14
|
+
raw_attributes: Mapping[str, Any]
|
|
15
|
+
created_at: str
|
|
16
|
+
updated_at: str
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
from typing import Any, Literal
|
|
2
|
+
from pydantic import BeforeValidator, ValidationInfo
|
|
3
|
+
from typing_extensions import Annotated
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
ApiDirectoryState = Literal[
|
|
7
|
+
"active",
|
|
8
|
+
"inactive",
|
|
9
|
+
"validating",
|
|
10
|
+
"deleting",
|
|
11
|
+
"invalid_credentials",
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def convert_legacy_directory_state(value: Any, info: ValidationInfo) -> Any:
|
|
16
|
+
if isinstance(value, str):
|
|
17
|
+
if value == "linked":
|
|
18
|
+
return "active"
|
|
19
|
+
elif value == "unlinked":
|
|
20
|
+
return "inactive"
|
|
21
|
+
|
|
22
|
+
return value
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
DirectoryState = Annotated[
|
|
26
|
+
ApiDirectoryState,
|
|
27
|
+
BeforeValidator(convert_legacy_directory_state),
|
|
28
|
+
]
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
from typing import Literal
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
DirectoryType = Literal[
|
|
5
|
+
"azure scim v2.0",
|
|
6
|
+
"bamboohr",
|
|
7
|
+
"breathe hr",
|
|
8
|
+
"cezanne hr",
|
|
9
|
+
"cyperark scim v2.0",
|
|
10
|
+
"fourth hr",
|
|
11
|
+
"generic scim v2.0",
|
|
12
|
+
"gsuite directory",
|
|
13
|
+
"hibob",
|
|
14
|
+
"jump cloud scim v2.0",
|
|
15
|
+
"okta scim v2.0",
|
|
16
|
+
"onelogin scim v2.0",
|
|
17
|
+
"people hr",
|
|
18
|
+
"personio",
|
|
19
|
+
"pingfederate scim v2.0",
|
|
20
|
+
"rippling v2.0",
|
|
21
|
+
"sftp",
|
|
22
|
+
"sftp workday",
|
|
23
|
+
"workday",
|
|
24
|
+
]
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
from typing import Any, Dict, Literal, Optional, Sequence, Union
|
|
2
|
+
|
|
3
|
+
from workos.types.workos_model import WorkOSModel
|
|
4
|
+
from workos.types.directory_sync.directory_group import DirectoryGroup
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
DirectoryUserState = Literal["active", "inactive"]
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class DirectoryUserEmail(WorkOSModel):
|
|
11
|
+
type: Optional[str] = None
|
|
12
|
+
value: Optional[str] = None
|
|
13
|
+
primary: Optional[bool] = None
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class InlineRole(WorkOSModel):
|
|
17
|
+
slug: str
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class DirectoryUser(WorkOSModel):
|
|
21
|
+
id: str
|
|
22
|
+
object: Literal["directory_user"]
|
|
23
|
+
idp_id: str
|
|
24
|
+
directory_id: str
|
|
25
|
+
organization_id: str
|
|
26
|
+
first_name: Optional[str] = None
|
|
27
|
+
last_name: Optional[str] = None
|
|
28
|
+
email: Optional[str] = None
|
|
29
|
+
# @deprecated Will be removed in a future major version. Enable the `job_title` custom attribute in dashboard and pull from customAttributes instead. See https://workos.com/docs/directory-sync/attributes/custom-attributes/auto-mapped-attributes for details.
|
|
30
|
+
job_title: Optional[str] = None
|
|
31
|
+
# @deprecated Will be removed in a future major version. Enable the `emails` custom attribute in dashboard and pull from customAttributes instead. See https://workos.com/docs/directory-sync/attributes/custom-attributes/auto-mapped-attributes for details.
|
|
32
|
+
emails: Sequence[DirectoryUserEmail]
|
|
33
|
+
# @deprecated Will be removed in a future major version. Enable the `username` custom attribute in dashboard and pull from customAttributes instead. See https://workos.com/docs/directory-sync/attributes/custom-attributes/auto-mapped-attributes for details.
|
|
34
|
+
username: Optional[str] = None
|
|
35
|
+
state: DirectoryUserState
|
|
36
|
+
custom_attributes: Dict[str, Any]
|
|
37
|
+
raw_attributes: Dict[str, Any]
|
|
38
|
+
created_at: str
|
|
39
|
+
updated_at: str
|
|
40
|
+
role: Optional[InlineRole] = None
|
|
41
|
+
roles: Optional[Sequence[InlineRole]] = None
|
|
42
|
+
|
|
43
|
+
def primary_email(self) -> Union[DirectoryUserEmail, None]:
|
|
44
|
+
return next((email for email in self.emails if email.primary), None)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
class DirectoryUserWithGroups(DirectoryUser):
|
|
48
|
+
"""Representation of a Directory User as returned by WorkOS through the Directory Sync feature."""
|
|
49
|
+
|
|
50
|
+
groups: Sequence[DirectoryGroup]
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
from workos.types.list_resource import ListArgs
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class DirectoryListFilters(ListArgs, total=False):
|
|
6
|
+
search: Optional[str]
|
|
7
|
+
organization_id: Optional[str]
|
|
8
|
+
domain: Optional[str]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class DirectoryUserListFilters(
|
|
12
|
+
ListArgs,
|
|
13
|
+
total=False,
|
|
14
|
+
):
|
|
15
|
+
group: Optional[str]
|
|
16
|
+
directory: Optional[str]
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class DirectoryGroupListFilters(ListArgs, total=False):
|
|
20
|
+
user: Optional[str]
|
|
21
|
+
directory: Optional[str]
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
from .authentication_payload import *
|
|
2
|
+
from .connection_payload_with_legacy_fields import *
|
|
3
|
+
from .directory_group_membership_payload import *
|
|
4
|
+
from .directory_group_with_previous_attributes import *
|
|
5
|
+
from .directory_payload import *
|
|
6
|
+
from .directory_payload_with_legacy_fields import *
|
|
7
|
+
from .directory_user_with_previous_attributes import *
|
|
8
|
+
from .event_model import *
|
|
9
|
+
from .event_type import *
|
|
10
|
+
from .event import *
|
|
11
|
+
from .organization_domain_verification_failed_payload import *
|
|
12
|
+
from .previous_attributes import *
|
|
13
|
+
from .session_payload import *
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
from typing import Literal, Optional
|
|
2
|
+
from workos.types.workos_model import WorkOSModel
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class AuthenticationResultCommon(WorkOSModel):
|
|
6
|
+
ip_address: Optional[str] = None
|
|
7
|
+
user_agent: Optional[str] = None
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class AuthenticationResultSucceeded(AuthenticationResultCommon):
|
|
11
|
+
status: Literal["succeeded"]
|
|
12
|
+
email: str
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class ErrorWithCode(WorkOSModel):
|
|
16
|
+
code: str
|
|
17
|
+
message: str
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class AuthenticationResultFailed(AuthenticationResultCommon):
|
|
21
|
+
status: Literal["failed"]
|
|
22
|
+
error: ErrorWithCode
|
|
23
|
+
email: Optional[str] = None
|
|
24
|
+
user_id: Optional[str] = None
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class AuthenticationEmailVerificationSucceededPayload(AuthenticationResultSucceeded):
|
|
28
|
+
type: Literal["email_verification"]
|
|
29
|
+
user_id: str
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class AuthenticationMagicAuthFailedPayload(AuthenticationResultFailed):
|
|
33
|
+
type: Literal["magic_auth"]
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class AuthenticationMagicAuthSucceededPayload(AuthenticationResultSucceeded):
|
|
37
|
+
type: Literal["magic_auth"]
|
|
38
|
+
user_id: str
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
class AuthenticationMfaSucceededPayload(AuthenticationResultSucceeded):
|
|
42
|
+
type: Literal["mfa"]
|
|
43
|
+
user_id: Optional[str] = None
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
class AuthenticationOauthFailedPayload(AuthenticationResultFailed):
|
|
47
|
+
type: Literal["oauth"]
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
class AuthenticationOauthSucceededPayload(AuthenticationResultSucceeded):
|
|
51
|
+
type: Literal["oauth"]
|
|
52
|
+
user_id: Optional[str] = None
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
class AuthenticationPasswordFailedPayload(AuthenticationResultFailed):
|
|
56
|
+
type: Literal["password"]
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
class AuthenticationPasswordSucceededPayload(AuthenticationResultSucceeded):
|
|
60
|
+
type: Literal["password"]
|
|
61
|
+
user_id: str
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
class AuthenticationSsoFailedPayload(AuthenticationResultFailed):
|
|
65
|
+
type: Literal["sso"]
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
class AuthenticationSsoSucceededPayload(AuthenticationResultSucceeded):
|
|
69
|
+
type: Literal["sso"]
|
|
70
|
+
user_id: Optional[str] = None
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
from workos.types.directory_sync import DirectoryGroup
|
|
2
|
+
from workos.types.workos_model import WorkOSModel
|
|
3
|
+
from workos.types.directory_sync.directory_user import DirectoryUser
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class DirectoryGroupMembershipPayload(WorkOSModel):
|
|
7
|
+
directory_id: str
|
|
8
|
+
user: DirectoryUser
|
|
9
|
+
group: DirectoryGroup
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from typing import Literal
|
|
2
|
+
from workos.types.directory_sync import DirectoryType
|
|
3
|
+
from workos.types.workos_model import WorkOSModel
|
|
4
|
+
from workos.types.directory_sync.directory_state import DirectoryState
|
|
5
|
+
from workos.typing.literals import LiteralOrUntyped
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class DirectoryPayload(WorkOSModel):
|
|
9
|
+
id: str
|
|
10
|
+
name: str
|
|
11
|
+
state: LiteralOrUntyped[DirectoryState]
|
|
12
|
+
type: LiteralOrUntyped[DirectoryType]
|
|
13
|
+
organization_id: str
|
|
14
|
+
created_at: str
|
|
15
|
+
updated_at: str
|
|
16
|
+
object: Literal["directory"]
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
from typing import Literal, Sequence
|
|
2
|
+
from workos.types.workos_model import WorkOSModel
|
|
3
|
+
from workos.types.events.directory_payload import DirectoryPayload
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class MinimalOrganizationDomain(WorkOSModel):
|
|
7
|
+
id: str
|
|
8
|
+
# TODO: This should be domain: str in the
|
|
9
|
+
# next major version to fix object parsing.
|
|
10
|
+
organization_id: str
|
|
11
|
+
object: Literal["organization_domain"]
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# TODO: This class should be removed in the next major version once MinimalOrganizationDomain is updated.
|
|
15
|
+
class MinimalOrganizationDomainForEventsApi(WorkOSModel):
|
|
16
|
+
id: str
|
|
17
|
+
domain: str
|
|
18
|
+
object: Literal["organization_domain"]
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class DirectoryPayloadWithLegacyFields(DirectoryPayload):
|
|
22
|
+
domains: Sequence[MinimalOrganizationDomain]
|
|
23
|
+
external_key: str
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
# TODO: This class should be removed in the next major version once MinimalOrganizationDomain is updated.
|
|
27
|
+
class DirectoryPayloadWithLegacyFieldsForEventsApi(DirectoryPayload):
|
|
28
|
+
domains: Sequence[MinimalOrganizationDomainForEventsApi]
|
|
29
|
+
external_key: str
|
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
from typing import Literal, Union
|
|
2
|
+
from pydantic import Field
|
|
3
|
+
from typing_extensions import Annotated
|
|
4
|
+
from workos.types.user_management import OrganizationMembership, User
|
|
5
|
+
from workos.types.directory_sync.directory_group import DirectoryGroup
|
|
6
|
+
from workos.types.directory_sync.directory_user import DirectoryUser
|
|
7
|
+
from workos.types.events.authentication_payload import (
|
|
8
|
+
AuthenticationEmailVerificationSucceededPayload,
|
|
9
|
+
AuthenticationMagicAuthFailedPayload,
|
|
10
|
+
AuthenticationMagicAuthSucceededPayload,
|
|
11
|
+
AuthenticationMfaSucceededPayload,
|
|
12
|
+
AuthenticationOauthFailedPayload,
|
|
13
|
+
AuthenticationOauthSucceededPayload,
|
|
14
|
+
AuthenticationPasswordFailedPayload,
|
|
15
|
+
AuthenticationPasswordSucceededPayload,
|
|
16
|
+
AuthenticationSsoFailedPayload,
|
|
17
|
+
AuthenticationSsoSucceededPayload,
|
|
18
|
+
)
|
|
19
|
+
from workos.types.events.connection_payload_with_legacy_fields import (
|
|
20
|
+
ConnectionPayloadWithLegacyFields,
|
|
21
|
+
)
|
|
22
|
+
from workos.types.events.directory_group_membership_payload import (
|
|
23
|
+
DirectoryGroupMembershipPayload,
|
|
24
|
+
)
|
|
25
|
+
from workos.types.events.directory_group_with_previous_attributes import (
|
|
26
|
+
DirectoryGroupWithPreviousAttributes,
|
|
27
|
+
)
|
|
28
|
+
from workos.types.events.directory_payload import DirectoryPayload
|
|
29
|
+
from workos.types.events.directory_payload_with_legacy_fields import (
|
|
30
|
+
DirectoryPayloadWithLegacyFieldsForEventsApi,
|
|
31
|
+
)
|
|
32
|
+
from workos.types.events.directory_user_with_previous_attributes import (
|
|
33
|
+
DirectoryUserWithPreviousAttributes,
|
|
34
|
+
)
|
|
35
|
+
from workos.types.events.event_model import EventModel
|
|
36
|
+
from workos.types.events.organization_domain_verification_failed_payload import (
|
|
37
|
+
OrganizationDomainVerificationFailedPayload,
|
|
38
|
+
)
|
|
39
|
+
from workos.types.events.session_payload import (
|
|
40
|
+
SessionCreatedPayload,
|
|
41
|
+
SessionRevokedPayload,
|
|
42
|
+
)
|
|
43
|
+
from workos.types.organizations.organization_common import OrganizationCommon
|
|
44
|
+
from workos.types.organization_domains import OrganizationDomain
|
|
45
|
+
from workos.types.roles.role import EventRole
|
|
46
|
+
from workos.types.sso.connection import Connection
|
|
47
|
+
from workos.types.user_management.email_verification import (
|
|
48
|
+
EmailVerificationCommon,
|
|
49
|
+
)
|
|
50
|
+
from workos.types.user_management.invitation import InvitationCommon
|
|
51
|
+
from workos.types.user_management.magic_auth import MagicAuthCommon
|
|
52
|
+
from workos.types.user_management.password_reset import PasswordResetCommon
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
# README
|
|
56
|
+
# When adding a new event type, ensure the new event class is
|
|
57
|
+
# added to the Event union type at the bottom of this file, and
|
|
58
|
+
# the event name is added to the EventType union type in event_type.py.
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
class AuthenticationEmailVerificationSucceededEvent(
|
|
62
|
+
EventModel[AuthenticationEmailVerificationSucceededPayload,]
|
|
63
|
+
):
|
|
64
|
+
event: Literal["authentication.email_verification_succeeded"]
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
class AuthenticationMagicAuthFailedEvent(
|
|
68
|
+
EventModel[AuthenticationMagicAuthFailedPayload,]
|
|
69
|
+
):
|
|
70
|
+
event: Literal["authentication.magic_auth_failed"]
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
class AuthenticationMagicAuthSucceededEvent(
|
|
74
|
+
EventModel[AuthenticationMagicAuthSucceededPayload,]
|
|
75
|
+
):
|
|
76
|
+
event: Literal["authentication.magic_auth_succeeded"]
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
class AuthenticationMfaSucceededEvent(EventModel[AuthenticationMfaSucceededPayload]):
|
|
80
|
+
event: Literal["authentication.mfa_succeeded"]
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
class AuthenticationOauthFailedEvent(EventModel[AuthenticationOauthFailedPayload]):
|
|
84
|
+
event: Literal["authentication.oauth_failed"]
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
class AuthenticationOauthSucceededEvent(
|
|
88
|
+
EventModel[AuthenticationOauthSucceededPayload]
|
|
89
|
+
):
|
|
90
|
+
event: Literal["authentication.oauth_succeeded"]
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
class AuthenticationPasswordFailedEvent(
|
|
94
|
+
EventModel[AuthenticationPasswordFailedPayload]
|
|
95
|
+
):
|
|
96
|
+
event: Literal["authentication.password_failed"]
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
class AuthenticationPasswordSucceededEvent(
|
|
100
|
+
EventModel[AuthenticationPasswordSucceededPayload,]
|
|
101
|
+
):
|
|
102
|
+
event: Literal["authentication.password_succeeded"]
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
class AuthenticationSsoFailedEvent(EventModel[AuthenticationSsoFailedPayload]):
|
|
106
|
+
event: Literal["authentication.sso_failed"]
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
class AuthenticationSsoSucceededEvent(EventModel[AuthenticationSsoSucceededPayload]):
|
|
110
|
+
event: Literal["authentication.sso_succeeded"]
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
class ConnectionActivatedEvent(EventModel[ConnectionPayloadWithLegacyFields]):
|
|
114
|
+
event: Literal["connection.activated"]
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
class ConnectionDeactivatedEvent(EventModel[ConnectionPayloadWithLegacyFields]):
|
|
118
|
+
event: Literal["connection.deactivated"]
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
class ConnectionDeletedEvent(EventModel[Connection]):
|
|
122
|
+
event: Literal["connection.deleted"]
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
class DirectoryActivatedEvent(EventModel[DirectoryPayloadWithLegacyFieldsForEventsApi]):
|
|
126
|
+
event: Literal["dsync.activated"]
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
class DirectoryDeletedEvent(EventModel[DirectoryPayload]):
|
|
130
|
+
event: Literal["dsync.deleted"]
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
class DirectoryGroupCreatedEvent(EventModel[DirectoryGroup]):
|
|
134
|
+
event: Literal["dsync.group.created"]
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
class DirectoryGroupDeletedEvent(EventModel[DirectoryGroup]):
|
|
138
|
+
event: Literal["dsync.group.deleted"]
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
class DirectoryGroupUpdatedEvent(EventModel[DirectoryGroupWithPreviousAttributes]):
|
|
142
|
+
event: Literal["dsync.group.updated"]
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
class DirectoryUserCreatedEvent(EventModel[DirectoryUser]):
|
|
146
|
+
event: Literal["dsync.user.created"]
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
class DirectoryUserDeletedEvent(EventModel[DirectoryUser]):
|
|
150
|
+
event: Literal["dsync.user.deleted"]
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
class DirectoryUserUpdatedEvent(EventModel[DirectoryUserWithPreviousAttributes]):
|
|
154
|
+
event: Literal["dsync.user.updated"]
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
class DirectoryUserAddedToGroupEvent(EventModel[DirectoryGroupMembershipPayload]):
|
|
158
|
+
event: Literal["dsync.group.user_added"]
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
class DirectoryUserRemovedFromGroupEvent(EventModel[DirectoryGroupMembershipPayload]):
|
|
162
|
+
event: Literal["dsync.group.user_removed"]
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
class EmailVerificationCreatedEvent(EventModel[EmailVerificationCommon]):
|
|
166
|
+
event: Literal["email_verification.created"]
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
class InvitationAcceptedEvent(EventModel[InvitationCommon]):
|
|
170
|
+
event: Literal["invitation.accepted"]
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
class InvitationCreatedEvent(EventModel[InvitationCommon]):
|
|
174
|
+
event: Literal["invitation.created"]
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
class InvitationRevokedEvent(EventModel[InvitationCommon]):
|
|
178
|
+
event: Literal["invitation.revoked"]
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
class MagicAuthCreatedEvent(EventModel[MagicAuthCommon]):
|
|
182
|
+
event: Literal["magic_auth.created"]
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
class OrganizationCreatedEvent(EventModel[OrganizationCommon]):
|
|
186
|
+
event: Literal["organization.created"]
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
class OrganizationDeletedEvent(EventModel[OrganizationCommon]):
|
|
190
|
+
event: Literal["organization.deleted"]
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
class OrganizationUpdatedEvent(EventModel[OrganizationCommon]):
|
|
194
|
+
event: Literal["organization.updated"]
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
class OrganizationDomainVerificationFailedEvent(
|
|
198
|
+
EventModel[OrganizationDomainVerificationFailedPayload,]
|
|
199
|
+
):
|
|
200
|
+
event: Literal["organization_domain.verification_failed"]
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
class OrganizationDomainVerifiedEvent(EventModel[OrganizationDomain]):
|
|
204
|
+
event: Literal["organization_domain.verified"]
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
class OrganizationDomainCreatedEvent(EventModel[OrganizationDomain]):
|
|
208
|
+
event: Literal["organization_domain.created"]
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
class OrganizationDomainUpdatedEvent(EventModel[OrganizationDomain]):
|
|
212
|
+
event: Literal["organization_domain.updated"]
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
class OrganizationDomainDeletedEvent(EventModel[OrganizationDomain]):
|
|
216
|
+
event: Literal["organization_domain.deleted"]
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
class OrganizationMembershipCreatedEvent(EventModel[OrganizationMembership]):
|
|
220
|
+
event: Literal["organization_membership.created"]
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
class OrganizationMembershipDeletedEvent(EventModel[OrganizationMembership]):
|
|
224
|
+
event: Literal["organization_membership.deleted"]
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
class OrganizationMembershipUpdatedEvent(EventModel[OrganizationMembership]):
|
|
228
|
+
event: Literal["organization_membership.updated"]
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
class PasswordResetCreatedEvent(EventModel[PasswordResetCommon]):
|
|
232
|
+
event: Literal["password_reset.created"]
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
class PasswordResetSucceededEvent(EventModel[PasswordResetCommon]):
|
|
236
|
+
event: Literal["password_reset.succeeded"]
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
class RoleCreatedEvent(EventModel[EventRole]):
|
|
240
|
+
event: Literal["role.created"]
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
class RoleDeletedEvent(EventModel[EventRole]):
|
|
244
|
+
event: Literal["role.deleted"]
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
class RoleUpdatedEvent(EventModel[EventRole]):
|
|
248
|
+
event: Literal["role.updated"]
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
class SessionCreatedEvent(EventModel[SessionCreatedPayload]):
|
|
252
|
+
event: Literal["session.created"]
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
class SessionRevokedEvent(EventModel[SessionRevokedPayload]):
|
|
256
|
+
event: Literal["session.revoked"]
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
class UserCreatedEvent(EventModel[User]):
|
|
260
|
+
event: Literal["user.created"]
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
class UserDeletedEvent(EventModel[User]):
|
|
264
|
+
event: Literal["user.deleted"]
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
class UserUpdatedEvent(EventModel[User]):
|
|
268
|
+
event: Literal["user.updated"]
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
Event = Annotated[
|
|
272
|
+
Union[
|
|
273
|
+
AuthenticationEmailVerificationSucceededEvent,
|
|
274
|
+
AuthenticationMagicAuthFailedEvent,
|
|
275
|
+
AuthenticationMagicAuthSucceededEvent,
|
|
276
|
+
AuthenticationMfaSucceededEvent,
|
|
277
|
+
AuthenticationOauthFailedEvent,
|
|
278
|
+
AuthenticationOauthSucceededEvent,
|
|
279
|
+
AuthenticationPasswordFailedEvent,
|
|
280
|
+
AuthenticationPasswordSucceededEvent,
|
|
281
|
+
AuthenticationSsoFailedEvent,
|
|
282
|
+
AuthenticationSsoSucceededEvent,
|
|
283
|
+
ConnectionActivatedEvent,
|
|
284
|
+
ConnectionDeactivatedEvent,
|
|
285
|
+
ConnectionDeletedEvent,
|
|
286
|
+
DirectoryActivatedEvent,
|
|
287
|
+
DirectoryDeletedEvent,
|
|
288
|
+
DirectoryGroupCreatedEvent,
|
|
289
|
+
DirectoryGroupDeletedEvent,
|
|
290
|
+
DirectoryGroupUpdatedEvent,
|
|
291
|
+
DirectoryUserCreatedEvent,
|
|
292
|
+
DirectoryUserDeletedEvent,
|
|
293
|
+
DirectoryUserUpdatedEvent,
|
|
294
|
+
DirectoryUserAddedToGroupEvent,
|
|
295
|
+
DirectoryUserRemovedFromGroupEvent,
|
|
296
|
+
EmailVerificationCreatedEvent,
|
|
297
|
+
InvitationAcceptedEvent,
|
|
298
|
+
InvitationCreatedEvent,
|
|
299
|
+
InvitationRevokedEvent,
|
|
300
|
+
MagicAuthCreatedEvent,
|
|
301
|
+
OrganizationCreatedEvent,
|
|
302
|
+
OrganizationDeletedEvent,
|
|
303
|
+
OrganizationUpdatedEvent,
|
|
304
|
+
OrganizationDomainCreatedEvent,
|
|
305
|
+
OrganizationDomainDeletedEvent,
|
|
306
|
+
OrganizationDomainUpdatedEvent,
|
|
307
|
+
OrganizationDomainVerificationFailedEvent,
|
|
308
|
+
OrganizationDomainVerifiedEvent,
|
|
309
|
+
OrganizationMembershipCreatedEvent,
|
|
310
|
+
OrganizationMembershipDeletedEvent,
|
|
311
|
+
OrganizationMembershipUpdatedEvent,
|
|
312
|
+
PasswordResetCreatedEvent,
|
|
313
|
+
PasswordResetSucceededEvent,
|
|
314
|
+
RoleCreatedEvent,
|
|
315
|
+
RoleDeletedEvent,
|
|
316
|
+
RoleUpdatedEvent,
|
|
317
|
+
SessionCreatedEvent,
|
|
318
|
+
SessionRevokedEvent,
|
|
319
|
+
UserCreatedEvent,
|
|
320
|
+
UserDeletedEvent,
|
|
321
|
+
UserUpdatedEvent,
|
|
322
|
+
],
|
|
323
|
+
Field(..., discriminator="event"),
|
|
324
|
+
]
|