vortex-python-sdk 0.9.1__tar.gz → 0.9.3__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.3
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
@@ -203,6 +203,46 @@ async def reinvite_user():
203
203
  invitation = vortex.reinvite_sync("invitation-id")
204
204
  ```
205
205
 
206
+ #### Sync Internal Invitation
207
+
208
+ If you're using `internal` delivery type invitations and managing the invitation flow within your own application, you can sync invitation decisions back to Vortex when users accept or decline invitations in your system.
209
+
210
+ ```python
211
+ async def sync_internal_invitation_action():
212
+ # Async version
213
+ result = await vortex.sync_internal_invitation(
214
+ creator_id="user-123", # The inviter's user ID in your system
215
+ target_value="user-456", # The invitee's user ID in your system
216
+ action="accepted", # "accepted" or "declined"
217
+ component_id="component-uuid" # The widget component UUID
218
+ )
219
+ print(f"Processed: {result['processed']}")
220
+ print(f"Invitation IDs: {result['invitationIds']}")
221
+
222
+ # Sync version
223
+ result = vortex.sync_internal_invitation_sync(
224
+ creator_id="user-123",
225
+ target_value="user-456",
226
+ action="accepted",
227
+ component_id="component-uuid"
228
+ )
229
+ ```
230
+
231
+ **Parameters:**
232
+ - `creator_id` (str) — The inviter's user ID in your system
233
+ - `target_value` (str) — The invitee's user ID in your system
234
+ - `action` ("accepted" | "declined") — The invitation decision
235
+ - `component_id` (str) — The widget component UUID
236
+
237
+ **Response:**
238
+ - `processed` (int) — Count of invitations processed
239
+ - `invitationIds` (list[str]) — IDs of processed invitations
240
+
241
+ **Use cases:**
242
+ - You handle invitation delivery through your own in-app notifications or UI
243
+ - Users accept/decline invitations within your application
244
+ - You need to keep Vortex updated with the invitation status
245
+
206
246
  ### Context Manager Usage
207
247
 
208
248
  ```python
@@ -165,6 +165,46 @@ async def reinvite_user():
165
165
  invitation = vortex.reinvite_sync("invitation-id")
166
166
  ```
167
167
 
168
+ #### Sync Internal Invitation
169
+
170
+ If you're using `internal` delivery type invitations and managing the invitation flow within your own application, you can sync invitation decisions back to Vortex when users accept or decline invitations in your system.
171
+
172
+ ```python
173
+ async def sync_internal_invitation_action():
174
+ # Async version
175
+ result = await vortex.sync_internal_invitation(
176
+ creator_id="user-123", # The inviter's user ID in your system
177
+ target_value="user-456", # The invitee's user ID in your system
178
+ action="accepted", # "accepted" or "declined"
179
+ component_id="component-uuid" # The widget component UUID
180
+ )
181
+ print(f"Processed: {result['processed']}")
182
+ print(f"Invitation IDs: {result['invitationIds']}")
183
+
184
+ # Sync version
185
+ result = vortex.sync_internal_invitation_sync(
186
+ creator_id="user-123",
187
+ target_value="user-456",
188
+ action="accepted",
189
+ component_id="component-uuid"
190
+ )
191
+ ```
192
+
193
+ **Parameters:**
194
+ - `creator_id` (str) — The inviter's user ID in your system
195
+ - `target_value` (str) — The invitee's user ID in your system
196
+ - `action` ("accepted" | "declined") — The invitation decision
197
+ - `component_id` (str) — The widget component UUID
198
+
199
+ **Response:**
200
+ - `processed` (int) — Count of invitations processed
201
+ - `invitationIds` (list[str]) — IDs of processed invitations
202
+
203
+ **Use cases:**
204
+ - You handle invitation delivery through your own in-app notifications or UI
205
+ - Users accept/decline invitations within your application
206
+ - You need to keep Vortex updated with the invitation status
207
+
168
208
  ### Context Manager Usage
169
209
 
170
210
  ```python
@@ -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.3"
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.3
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
@@ -203,6 +203,46 @@ async def reinvite_user():
203
203
  invitation = vortex.reinvite_sync("invitation-id")
204
204
  ```
205
205
 
206
+ #### Sync Internal Invitation
207
+
208
+ If you're using `internal` delivery type invitations and managing the invitation flow within your own application, you can sync invitation decisions back to Vortex when users accept or decline invitations in your system.
209
+
210
+ ```python
211
+ async def sync_internal_invitation_action():
212
+ # Async version
213
+ result = await vortex.sync_internal_invitation(
214
+ creator_id="user-123", # The inviter's user ID in your system
215
+ target_value="user-456", # The invitee's user ID in your system
216
+ action="accepted", # "accepted" or "declined"
217
+ component_id="component-uuid" # The widget component UUID
218
+ )
219
+ print(f"Processed: {result['processed']}")
220
+ print(f"Invitation IDs: {result['invitationIds']}")
221
+
222
+ # Sync version
223
+ result = vortex.sync_internal_invitation_sync(
224
+ creator_id="user-123",
225
+ target_value="user-456",
226
+ action="accepted",
227
+ component_id="component-uuid"
228
+ )
229
+ ```
230
+
231
+ **Parameters:**
232
+ - `creator_id` (str) — The inviter's user ID in your system
233
+ - `target_value` (str) — The invitee's user ID in your system
234
+ - `action` ("accepted" | "declined") — The invitation decision
235
+ - `component_id` (str) — The widget component UUID
236
+
237
+ **Response:**
238
+ - `processed` (int) — Count of invitations processed
239
+ - `invitationIds` (list[str]) — IDs of processed invitations
240
+
241
+ **Use cases:**
242
+ - You handle invitation delivery through your own in-app notifications or UI
243
+ - Users accept/decline invitations within your application
244
+ - You need to keep Vortex updated with the invitation status
245
+
206
246
  ### Context Manager Usage
207
247
 
208
248
  ```python
@@ -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()