workos 5.35.0__py3-none-any.whl → 5.37.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/types/events/__init__.py +1 -1
- workos/types/events/event.py +9 -1
- workos/types/events/event_model.py +6 -1
- workos/types/events/event_type.py +1 -0
- workos/types/events/{session_created_payload.py → session_payload.py} +12 -0
- workos/types/webhooks/webhook.py +9 -1
- workos/user_management.py +86 -0
- {workos-5.35.0.dist-info → workos-5.37.0.dist-info}/METADATA +1 -1
- {workos-5.35.0.dist-info → workos-5.37.0.dist-info}/RECORD +13 -13
- {workos-5.35.0.dist-info → workos-5.37.0.dist-info}/LICENSE +0 -0
- {workos-5.35.0.dist-info → workos-5.37.0.dist-info}/WHEEL +0 -0
- {workos-5.35.0.dist-info → workos-5.37.0.dist-info}/top_level.txt +0 -0
workos/__about__.py
CHANGED
workos/types/events/__init__.py
CHANGED
workos/types/events/event.py
CHANGED
|
@@ -36,7 +36,10 @@ from workos.types.events.event_model import EventModel
|
|
|
36
36
|
from workos.types.events.organization_domain_verification_failed_payload import (
|
|
37
37
|
OrganizationDomainVerificationFailedPayload,
|
|
38
38
|
)
|
|
39
|
-
from workos.types.events.
|
|
39
|
+
from workos.types.events.session_payload import (
|
|
40
|
+
SessionCreatedPayload,
|
|
41
|
+
SessionRevokedPayload,
|
|
42
|
+
)
|
|
40
43
|
from workos.types.organizations.organization_common import OrganizationCommon
|
|
41
44
|
from workos.types.organization_domains import OrganizationDomain
|
|
42
45
|
from workos.types.roles.role import EventRole
|
|
@@ -249,6 +252,10 @@ class SessionCreatedEvent(EventModel[SessionCreatedPayload]):
|
|
|
249
252
|
event: Literal["session.created"]
|
|
250
253
|
|
|
251
254
|
|
|
255
|
+
class SessionRevokedEvent(EventModel[SessionRevokedPayload]):
|
|
256
|
+
event: Literal["session.revoked"]
|
|
257
|
+
|
|
258
|
+
|
|
252
259
|
class UserCreatedEvent(EventModel[User]):
|
|
253
260
|
event: Literal["user.created"]
|
|
254
261
|
|
|
@@ -308,6 +315,7 @@ Event = Annotated[
|
|
|
308
315
|
RoleDeletedEvent,
|
|
309
316
|
RoleUpdatedEvent,
|
|
310
317
|
SessionCreatedEvent,
|
|
318
|
+
SessionRevokedEvent,
|
|
311
319
|
UserCreatedEvent,
|
|
312
320
|
UserDeletedEvent,
|
|
313
321
|
UserUpdatedEvent,
|
|
@@ -35,7 +35,11 @@ from workos.types.events.directory_user_with_previous_attributes import (
|
|
|
35
35
|
from workos.types.events.organization_domain_verification_failed_payload import (
|
|
36
36
|
OrganizationDomainVerificationFailedPayload,
|
|
37
37
|
)
|
|
38
|
-
|
|
38
|
+
|
|
39
|
+
from workos.types.events.session_payload import (
|
|
40
|
+
SessionCreatedPayload,
|
|
41
|
+
SessionRevokedPayload,
|
|
42
|
+
)
|
|
39
43
|
from workos.types.organizations.organization_common import OrganizationCommon
|
|
40
44
|
from workos.types.organization_domains import OrganizationDomain
|
|
41
45
|
from workos.types.roles.role import EventRole
|
|
@@ -81,6 +85,7 @@ EventPayload = TypeVar(
|
|
|
81
85
|
OrganizationMembership,
|
|
82
86
|
PasswordResetCommon,
|
|
83
87
|
SessionCreatedPayload,
|
|
88
|
+
SessionRevokedPayload,
|
|
84
89
|
User,
|
|
85
90
|
)
|
|
86
91
|
|
|
@@ -13,3 +13,15 @@ class SessionCreatedPayload(WorkOSModel):
|
|
|
13
13
|
user_id: str
|
|
14
14
|
created_at: str
|
|
15
15
|
updated_at: str
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class SessionRevokedPayload(WorkOSModel):
|
|
19
|
+
object: Literal["session"]
|
|
20
|
+
id: str
|
|
21
|
+
impersonator: Optional[Impersonator] = None
|
|
22
|
+
ip_address: Optional[str] = None
|
|
23
|
+
organization_id: Optional[str] = None
|
|
24
|
+
user_agent: Optional[str] = None
|
|
25
|
+
user_id: str
|
|
26
|
+
created_at: str
|
|
27
|
+
updated_at: str
|
workos/types/webhooks/webhook.py
CHANGED
|
@@ -36,7 +36,10 @@ from workos.types.events.directory_user_with_previous_attributes import (
|
|
|
36
36
|
from workos.types.events.organization_domain_verification_failed_payload import (
|
|
37
37
|
OrganizationDomainVerificationFailedPayload,
|
|
38
38
|
)
|
|
39
|
-
from workos.types.events.
|
|
39
|
+
from workos.types.events.session_payload import (
|
|
40
|
+
SessionCreatedPayload,
|
|
41
|
+
SessionRevokedPayload,
|
|
42
|
+
)
|
|
40
43
|
from workos.types.organization_domains import OrganizationDomain
|
|
41
44
|
from workos.types.organizations.organization_common import OrganizationCommon
|
|
42
45
|
from workos.types.roles.role import EventRole
|
|
@@ -255,6 +258,10 @@ class SessionCreatedWebhook(WebhookModel[SessionCreatedPayload]):
|
|
|
255
258
|
event: Literal["session.created"]
|
|
256
259
|
|
|
257
260
|
|
|
261
|
+
class SessionRevokedWebhook(WebhookModel[SessionRevokedPayload]):
|
|
262
|
+
event: Literal["session.revoked"]
|
|
263
|
+
|
|
264
|
+
|
|
258
265
|
class UserCreatedWebhook(WebhookModel[User]):
|
|
259
266
|
event: Literal["user.created"]
|
|
260
267
|
|
|
@@ -314,6 +321,7 @@ Webhook = Annotated[
|
|
|
314
321
|
RoleDeletedWebhook,
|
|
315
322
|
RoleUpdatedWebhook,
|
|
316
323
|
SessionCreatedWebhook,
|
|
324
|
+
SessionRevokedWebhook,
|
|
317
325
|
UserCreatedWebhook,
|
|
318
326
|
UserDeletedWebhook,
|
|
319
327
|
UserUpdatedWebhook,
|
workos/user_management.py
CHANGED
|
@@ -2,6 +2,8 @@ from typing import Awaitable, Optional, Protocol, Sequence, Type, Union, cast
|
|
|
2
2
|
from urllib.parse import urlencode
|
|
3
3
|
from workos._client_configuration import ClientConfiguration
|
|
4
4
|
from workos.session import AsyncSession, Session
|
|
5
|
+
from workos.types.feature_flags import FeatureFlag
|
|
6
|
+
from workos.types.feature_flags.list_filters import FeatureFlagListFilters
|
|
5
7
|
from workos.types.list_resource import (
|
|
6
8
|
ListArgs,
|
|
7
9
|
ListMetadata,
|
|
@@ -97,6 +99,7 @@ INVITATION_REVOKE_PATH = "user_management/invitations/{0}/revoke"
|
|
|
97
99
|
INVITATION_RESEND_PATH = "user_management/invitations/{0}/resend"
|
|
98
100
|
PASSWORD_RESET_PATH = "user_management/password_reset"
|
|
99
101
|
PASSWORD_RESET_DETAIL_PATH = "user_management/password_reset/{0}"
|
|
102
|
+
USER_FEATURE_FLAGS_PATH = "user_management/users/{0}/feature-flags"
|
|
100
103
|
|
|
101
104
|
|
|
102
105
|
UsersListResource = WorkOSListResource[User, UsersListFilters, ListMetadata]
|
|
@@ -113,6 +116,10 @@ InvitationsListResource = WorkOSListResource[
|
|
|
113
116
|
Invitation, InvitationsListFilters, ListMetadata
|
|
114
117
|
]
|
|
115
118
|
|
|
119
|
+
FeatureFlagsListResource = WorkOSListResource[
|
|
120
|
+
FeatureFlag, FeatureFlagListFilters, ListMetadata
|
|
121
|
+
]
|
|
122
|
+
|
|
116
123
|
from workos.types.user_management.list_filters import SessionsListFilters
|
|
117
124
|
|
|
118
125
|
SessionsListResource = WorkOSListResource[
|
|
@@ -908,6 +915,29 @@ class UserManagementModule(Protocol):
|
|
|
908
915
|
"""
|
|
909
916
|
...
|
|
910
917
|
|
|
918
|
+
def list_feature_flags(
|
|
919
|
+
self,
|
|
920
|
+
user_id: str,
|
|
921
|
+
*,
|
|
922
|
+
limit: int = DEFAULT_LIST_RESPONSE_LIMIT,
|
|
923
|
+
before: Optional[str] = None,
|
|
924
|
+
after: Optional[str] = None,
|
|
925
|
+
order: PaginationOrder = "desc",
|
|
926
|
+
) -> SyncOrAsync[FeatureFlagsListResource]:
|
|
927
|
+
"""Retrieve a list of feature flags for a user
|
|
928
|
+
|
|
929
|
+
Args:
|
|
930
|
+
user_id (str): User's unique identifier
|
|
931
|
+
limit (int): Maximum number of records to return. (Optional)
|
|
932
|
+
before (str): Pagination cursor to receive records before a provided Feature Flag ID. (Optional)
|
|
933
|
+
after (str): Pagination cursor to receive records after a provided Feature Flag ID. (Optional)
|
|
934
|
+
order (Literal["asc","desc"]): Sort records in either ascending or descending (default) order by created_at timestamp. (Optional)
|
|
935
|
+
|
|
936
|
+
Returns:
|
|
937
|
+
FeatureFlagsListResource: Feature flags list response from WorkOS.
|
|
938
|
+
"""
|
|
939
|
+
...
|
|
940
|
+
|
|
911
941
|
|
|
912
942
|
class UserManagement(UserManagementModule):
|
|
913
943
|
_http_client: SyncHTTPClient
|
|
@@ -1603,6 +1633,34 @@ class UserManagement(UserManagementModule):
|
|
|
1603
1633
|
|
|
1604
1634
|
return Invitation.model_validate(response)
|
|
1605
1635
|
|
|
1636
|
+
def list_feature_flags(
|
|
1637
|
+
self,
|
|
1638
|
+
user_id: str,
|
|
1639
|
+
*,
|
|
1640
|
+
limit: int = DEFAULT_LIST_RESPONSE_LIMIT,
|
|
1641
|
+
before: Optional[str] = None,
|
|
1642
|
+
after: Optional[str] = None,
|
|
1643
|
+
order: PaginationOrder = "desc",
|
|
1644
|
+
) -> FeatureFlagsListResource:
|
|
1645
|
+
list_params: FeatureFlagListFilters = {
|
|
1646
|
+
"limit": limit,
|
|
1647
|
+
"before": before,
|
|
1648
|
+
"after": after,
|
|
1649
|
+
"order": order,
|
|
1650
|
+
}
|
|
1651
|
+
|
|
1652
|
+
response = self._http_client.request(
|
|
1653
|
+
USER_FEATURE_FLAGS_PATH.format(user_id),
|
|
1654
|
+
method=REQUEST_METHOD_GET,
|
|
1655
|
+
params=list_params,
|
|
1656
|
+
)
|
|
1657
|
+
|
|
1658
|
+
return FeatureFlagsListResource(
|
|
1659
|
+
list_method=self.list_feature_flags,
|
|
1660
|
+
list_args=list_params,
|
|
1661
|
+
**ListPage[FeatureFlag](**response).model_dump(),
|
|
1662
|
+
)
|
|
1663
|
+
|
|
1606
1664
|
|
|
1607
1665
|
class AsyncUserManagement(UserManagementModule):
|
|
1608
1666
|
_http_client: AsyncHTTPClient
|
|
@@ -2312,3 +2370,31 @@ class AsyncUserManagement(UserManagementModule):
|
|
|
2312
2370
|
)
|
|
2313
2371
|
|
|
2314
2372
|
return Invitation.model_validate(response)
|
|
2373
|
+
|
|
2374
|
+
async def list_feature_flags(
|
|
2375
|
+
self,
|
|
2376
|
+
user_id: str,
|
|
2377
|
+
*,
|
|
2378
|
+
limit: int = DEFAULT_LIST_RESPONSE_LIMIT,
|
|
2379
|
+
before: Optional[str] = None,
|
|
2380
|
+
after: Optional[str] = None,
|
|
2381
|
+
order: PaginationOrder = "desc",
|
|
2382
|
+
) -> FeatureFlagsListResource:
|
|
2383
|
+
list_params: FeatureFlagListFilters = {
|
|
2384
|
+
"limit": limit,
|
|
2385
|
+
"before": before,
|
|
2386
|
+
"after": after,
|
|
2387
|
+
"order": order,
|
|
2388
|
+
}
|
|
2389
|
+
|
|
2390
|
+
response = await self._http_client.request(
|
|
2391
|
+
USER_FEATURE_FLAGS_PATH.format(user_id),
|
|
2392
|
+
method=REQUEST_METHOD_GET,
|
|
2393
|
+
params=list_params,
|
|
2394
|
+
)
|
|
2395
|
+
|
|
2396
|
+
return FeatureFlagsListResource(
|
|
2397
|
+
list_method=self.list_feature_flags,
|
|
2398
|
+
list_args=list_params,
|
|
2399
|
+
**ListPage[FeatureFlag](**response).model_dump(),
|
|
2400
|
+
)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
workos/__about__.py,sha256=
|
|
1
|
+
workos/__about__.py,sha256=a8T8r-F_Bc9Q5_He3ZLzqGLEGQhwQ_2KCKENsHZ4q6g,406
|
|
2
2
|
workos/__init__.py,sha256=hOdbO_MJCvpLx8EbRjQg-fvFAB-glJmrmxUZK8kWG0k,167
|
|
3
3
|
workos/_base_client.py,sha256=CIfAk6Bdj1hpOy3TcfIGXy8X4Efa7wi7cKracjkcTHk,3633
|
|
4
4
|
workos/_client_configuration.py,sha256=g3eXhtrEMN6CW0hZ5uHb2PmLurXjyBkWZeQYMPeJD6s,222
|
|
@@ -18,7 +18,7 @@ workos/portal.py,sha256=lzf3fnOor4AyVdHCHMuJzVSpAC9LWWdC5sZIRtCsb0c,2443
|
|
|
18
18
|
workos/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
19
19
|
workos/session.py,sha256=Fh9Y7fyjoX_cK2TayhNzpL725pwrNg-QClsgEfuMZsU,12412
|
|
20
20
|
workos/sso.py,sha256=ZBC3y-IRmxG0jPd0BOj7s7XQkXJoTLUg1fx-h3Gfy4g,13541
|
|
21
|
-
workos/user_management.py,sha256=
|
|
21
|
+
workos/user_management.py,sha256=OJ-_RiLUhjL662t6A3t_eOBKfqWW0_sX-HjfiUS6hsc,86028
|
|
22
22
|
workos/vault.py,sha256=SJXr3nJ03qJFuf30FjevMD6LLlDNX3MGaKlYGgICRRE,15657
|
|
23
23
|
workos/webhooks.py,sha256=CuwBxh6va9VZFVSXOknveGt6CCGDF3em07a-J12DbXI,4790
|
|
24
24
|
workos/widgets.py,sha256=bfbR0hQOHZabbgGL2ekD5sY1sjiUoWBTdrBd_a6WmBc,1721
|
|
@@ -42,7 +42,7 @@ workos/types/directory_sync/directory_state.py,sha256=4qaD1Snonde1oVj1tDUITzXh0i
|
|
|
42
42
|
workos/types/directory_sync/directory_type.py,sha256=NuHJzxI80WjxKiCSwMj1dfMpfB4o5JHErfLWfxCnKRs,443
|
|
43
43
|
workos/types/directory_sync/directory_user.py,sha256=ZIlhkR2afO5cvWxEXAWsYjOy_sBC9_GBFaa5B3ZYyBo,2135
|
|
44
44
|
workos/types/directory_sync/list_filters.py,sha256=Q4jlocRp4DguCm5e4Oo7udK7IfKmm3N1Rojtg4Eu96w,449
|
|
45
|
-
workos/types/events/__init__.py,sha256=
|
|
45
|
+
workos/types/events/__init__.py,sha256=RX4PyjatDLhmNOV_9I08TfY1KjQZWL4CX6LbxhrMxaQ,540
|
|
46
46
|
workos/types/events/authentication_payload.py,sha256=-4DhxWNxyd0Q01w2R4RyoQAwxNrRKMYJAdcRJUrzjEk,1779
|
|
47
47
|
workos/types/events/connection_payload_with_legacy_fields.py,sha256=d0x4BHDMQfrCehKlaU40FcufBiASOtN38idfR5d8hbY,139
|
|
48
48
|
workos/types/events/directory_group_membership_payload.py,sha256=PD81lhsRWUxQmugKo7pm_E6rVAaiBa2sjDYVAoSPGVU,300
|
|
@@ -50,13 +50,13 @@ workos/types/events/directory_group_with_previous_attributes.py,sha256=13VLNhdJZ
|
|
|
50
50
|
workos/types/events/directory_payload.py,sha256=tRo3f9g8VoYertSUPAR25iGDyGLr2Dtb2mTkl73PAeA,503
|
|
51
51
|
workos/types/events/directory_payload_with_legacy_fields.py,sha256=jk9nLmRqgllVkBG4EU3uTgcDOhCNptHgCh93U7aBAYE,1005
|
|
52
52
|
workos/types/events/directory_user_with_previous_attributes.py,sha256=PhnO3WakBxAvnlOGf0UB0bvoppUYlwLyU-g9X_pPdko,244
|
|
53
|
-
workos/types/events/event.py,sha256=
|
|
54
|
-
workos/types/events/event_model.py,sha256=
|
|
55
|
-
workos/types/events/event_type.py,sha256=
|
|
53
|
+
workos/types/events/event.py,sha256=oSNel0-Wom2sRyJki7fKokV95Py-ujzbz6mE3Yd1sB0,10249
|
|
54
|
+
workos/types/events/event_model.py,sha256=T7LhScyPfAFoOLJdRK_LsS3aEuePSa1kcH3IzwvNRCw,3778
|
|
55
|
+
workos/types/events/event_type.py,sha256=YgxVsHTau5TGlgDIvruS7NGX7buMWbCCYIF9bV9BAuM,1766
|
|
56
56
|
workos/types/events/list_filters.py,sha256=P04zmRynx9VPqNX_MBXA-3KA6flPZJogtIUqTI7w9Eg,305
|
|
57
57
|
workos/types/events/organization_domain_verification_failed_payload.py,sha256=b4wX8HVbL9Nx6fCjOXkZg9eLc-Bv6YqAjMap1f7UvFc,470
|
|
58
58
|
workos/types/events/previous_attributes.py,sha256=DxolwLwzcnG8r_W6rh5BT29iDfSVsIELvRYJ0NCrNn0,72
|
|
59
|
-
workos/types/events/
|
|
59
|
+
workos/types/events/session_payload.py,sha256=fErEOkbZtuJSAnbJPaUJg5ZsUj5u05w6WHQguo_fZEM,770
|
|
60
60
|
workos/types/feature_flags/__init__.py,sha256=zQpY624xaDw8t94ZbNrl_iH9bHPrSYYSKHVDnd7XTmc,91
|
|
61
61
|
workos/types/feature_flags/feature_flag.py,sha256=fS1RP_mOJKMmnaNqpSsePkixbJAExx-153IKb29kC-4,268
|
|
62
62
|
workos/types/feature_flags/list_filters.py,sha256=iTnz1KNzxXAJunBMg-ZE63Mh2DaCFmS4S_q6AoL3rbI,112
|
|
@@ -114,7 +114,7 @@ workos/types/vault/__init__.py,sha256=krBuIl8luysrtDf9-b8KTkXOHDOaSsOR-Aao6Wlil0
|
|
|
114
114
|
workos/types/vault/key.py,sha256=x30XBplSj9AviDDAB8MdpcULbZvvo2sUzi8RCmZQKxU,453
|
|
115
115
|
workos/types/vault/object.py,sha256=-rk4KovS3eT8T8L3JltYUS0cd2Rg1JKcAX9SOaZO3D8,664
|
|
116
116
|
workos/types/webhooks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
117
|
-
workos/types/webhooks/webhook.py,sha256=
|
|
117
|
+
workos/types/webhooks/webhook.py,sha256=BtPliPkUWJgXYRCZCwZNLfCL-pBNaUrUxMyCvlmiMqM,10466
|
|
118
118
|
workos/types/webhooks/webhook_model.py,sha256=v7Hgtzt0nW_5RaYoB_QGVfElhdjySuG3F1BFjoid36w,404
|
|
119
119
|
workos/types/webhooks/webhook_payload.py,sha256=GXt31KtyBM-ji5K5p4dBnu46Gh8adQWTq0ye5USB_6g,68
|
|
120
120
|
workos/types/widgets/__init__.py,sha256=z2Tdlj_bJsRZeJRh4SOFX58PvJdf0LjKnYhrQX1fpME,65
|
|
@@ -131,8 +131,8 @@ workos/utils/crypto_provider.py,sha256=QeQSR4t9xLlb90kEfl8onVUsf1yCkYq0EjFTxK0mU
|
|
|
131
131
|
workos/utils/http_client.py,sha256=TM5yMFFExmAE8D2Z43-5O301tRbnylLG0aXO0isGorE,6197
|
|
132
132
|
workos/utils/pagination_order.py,sha256=_-et1DDJLG0czarTU7op4W6RA0V1f85GNsUgtyRU55Q,70
|
|
133
133
|
workos/utils/request_helper.py,sha256=NaO16qPPbSNnCeE0fiNKYb8gM-dK_okYVJbLGrEGXz8,793
|
|
134
|
-
workos-5.
|
|
135
|
-
workos-5.
|
|
136
|
-
workos-5.
|
|
137
|
-
workos-5.
|
|
138
|
-
workos-5.
|
|
134
|
+
workos-5.37.0.dist-info/LICENSE,sha256=mU--WL1JzelH2tXpKVoOlpud4cpqKSRTtdArCvYZmb4,1063
|
|
135
|
+
workos-5.37.0.dist-info/METADATA,sha256=6JP8iaTlAshQvSIykV7Fr2gYo-BwjBDXzwLISERf-gE,4187
|
|
136
|
+
workos-5.37.0.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
137
|
+
workos-5.37.0.dist-info/top_level.txt,sha256=ZFskIfue1Tw-JwjyIXRvdsAl9i0DX9VbqmgICXV84Sk,7
|
|
138
|
+
workos-5.37.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|