vortex-python-sdk 0.9.1__tar.gz → 0.9.2__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: vortex-python-sdk
3
- Version: 0.9.1
3
+ Version: 0.9.2
4
4
  Summary: Vortex Python SDK for invitation management and JWT generation
5
5
  Author-email: TeamVortexSoftware <support@vortexsoftware.com>
6
6
  License-Expression: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "vortex-python-sdk"
7
- version = "0.9.1"
7
+ version = "0.9.2"
8
8
  description = "Vortex Python SDK for invitation management and JWT generation"
9
9
  authors = [{name = "TeamVortexSoftware", email = "support@vortexsoftware.com"}]
10
10
  readme = "README.md"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: vortex-python-sdk
3
- Version: 0.9.1
3
+ Version: 0.9.2
4
4
  Summary: Vortex Python SDK for invitation management and JWT generation
5
5
  Author-email: TeamVortexSoftware <support@vortexsoftware.com>
6
6
  License-Expression: MIT
@@ -23,11 +23,13 @@ from .types import (
23
23
  InvitationResult,
24
24
  InvitationTarget,
25
25
  JwtPayload,
26
+ SyncInternalInvitationRequest,
27
+ SyncInternalInvitationResponse,
26
28
  VortexApiError,
27
29
  )
28
30
  from .vortex import Vortex
29
31
 
30
- __version__ = "0.7.0"
32
+ __version__ = "0.9.2"
31
33
  __author__ = "TeamVortexSoftware"
32
34
  __email__ = "support@vortexsoftware.com"
33
35
 
@@ -48,6 +50,8 @@ __all__ = [
48
50
  "AutojoinDomain",
49
51
  "AutojoinDomainsResponse",
50
52
  "ConfigureAutojoinRequest",
53
+ "SyncInternalInvitationRequest",
54
+ "SyncInternalInvitationResponse",
51
55
  "ApiResponse",
52
56
  "ApiResponseJson",
53
57
  "ApiRequestBody",
@@ -383,6 +383,26 @@ class AutojoinDomainsResponse(BaseModel):
383
383
  populate_by_name = True
384
384
 
385
385
 
386
+ class SyncInternalInvitationRequest(BaseModel):
387
+ """Request body for syncing an internal invitation action"""
388
+ creator_id: str = Field(alias="creatorId")
389
+ target_value: str = Field(alias="targetValue")
390
+ action: Literal["accepted", "declined"]
391
+ component_id: str = Field(alias="componentId")
392
+
393
+ class Config:
394
+ populate_by_name = True
395
+
396
+
397
+ class SyncInternalInvitationResponse(BaseModel):
398
+ """Response from syncing an internal invitation action"""
399
+ processed: int
400
+ invitation_ids: List[str] = Field(alias="invitationIds")
401
+
402
+ class Config:
403
+ populate_by_name = True
404
+
405
+
386
406
  class ConfigureAutojoinRequest(BaseModel):
387
407
  """Request body for configuring autojoin domains"""
388
408
  scope: str
@@ -22,6 +22,8 @@ from .types import (
22
22
  Invitation,
23
23
  InvitationTarget,
24
24
  Inviter,
25
+ SyncInternalInvitationRequest,
26
+ SyncInternalInvitationResponse,
25
27
  User,
26
28
  VortexApiError,
27
29
  )
@@ -997,6 +999,85 @@ class Vortex:
997
999
  )
998
1000
  return AutojoinDomainsResponse(**response)
999
1001
 
1002
+ async def sync_internal_invitation(
1003
+ self,
1004
+ creator_id: str,
1005
+ target_value: str,
1006
+ action: str,
1007
+ component_id: str,
1008
+ ) -> SyncInternalInvitationResponse:
1009
+ """
1010
+ Sync an internal invitation action (accept or decline)
1011
+
1012
+ This method notifies Vortex that an internal invitation was accepted or declined
1013
+ within your application, so Vortex can update the invitation status accordingly.
1014
+
1015
+ Args:
1016
+ creator_id: The inviter's user ID
1017
+ target_value: The invitee's user ID
1018
+ action: The action taken: "accepted" or "declined"
1019
+ component_id: The widget component UUID
1020
+
1021
+ Returns:
1022
+ SyncInternalInvitationResponse with processed count and invitation_ids
1023
+
1024
+ Example:
1025
+ result = await vortex.sync_internal_invitation(
1026
+ creator_id="user-123",
1027
+ target_value="user-456",
1028
+ action="accepted",
1029
+ component_id="component-uuid-789",
1030
+ )
1031
+ print(f"Processed {result.processed} invitations")
1032
+ """
1033
+ request = SyncInternalInvitationRequest(
1034
+ creator_id=creator_id,
1035
+ target_value=target_value,
1036
+ action=action,
1037
+ component_id=component_id,
1038
+ )
1039
+
1040
+ response = await self._vortex_api_request(
1041
+ "POST",
1042
+ "/invitation-actions/sync-internal-invitation",
1043
+ data=request.model_dump(by_alias=True),
1044
+ )
1045
+ return SyncInternalInvitationResponse(**response)
1046
+
1047
+ def sync_internal_invitation_sync(
1048
+ self,
1049
+ creator_id: str,
1050
+ target_value: str,
1051
+ action: str,
1052
+ component_id: str,
1053
+ ) -> SyncInternalInvitationResponse:
1054
+ """
1055
+ Sync an internal invitation action (accept or decline) (synchronous)
1056
+
1057
+ See sync_internal_invitation() for full documentation.
1058
+
1059
+ Example:
1060
+ result = vortex.sync_internal_invitation_sync(
1061
+ creator_id="user-123",
1062
+ target_value="user-456",
1063
+ action="accepted",
1064
+ component_id="component-uuid-789",
1065
+ )
1066
+ """
1067
+ request = SyncInternalInvitationRequest(
1068
+ creator_id=creator_id,
1069
+ target_value=target_value,
1070
+ action=action,
1071
+ component_id=component_id,
1072
+ )
1073
+
1074
+ response = self._vortex_api_request_sync(
1075
+ "POST",
1076
+ "/invitation-actions/sync-internal-invitation",
1077
+ data=request.model_dump(by_alias=True),
1078
+ )
1079
+ return SyncInternalInvitationResponse(**response)
1080
+
1000
1081
  async def close(self) -> None:
1001
1082
  """Close the HTTP client"""
1002
1083
  await self._client.aclose()