vortex-python-sdk 0.6.0__tar.gz → 0.7.0__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.6.0
3
+ Version: 0.7.0
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.6.0"
7
+ version = "0.7.0"
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.6.0
3
+ Version: 0.7.0
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
@@ -11,6 +11,9 @@ from .types import (
11
11
  ApiResponse,
12
12
  ApiResponseJson,
13
13
  AuthenticatedUser,
14
+ AutojoinDomain,
15
+ AutojoinDomainsResponse,
16
+ ConfigureAutojoinRequest,
14
17
  CreateInvitationRequest,
15
18
  GroupInput,
16
19
  IdentifierInput,
@@ -24,7 +27,7 @@ from .types import (
24
27
  )
25
28
  from .vortex import Vortex
26
29
 
27
- __version__ = "0.0.6"
30
+ __version__ = "0.7.0"
28
31
  __author__ = "TeamVortexSoftware"
29
32
  __email__ = "support@vortexsoftware.com"
30
33
 
@@ -42,6 +45,9 @@ __all__ = [
42
45
  "CreateInvitationRequest",
43
46
  "AcceptInvitationRequest",
44
47
  "AcceptInvitationsRequest", # Alias for AcceptInvitationRequest
48
+ "AutojoinDomain",
49
+ "AutojoinDomainsResponse",
50
+ "ConfigureAutojoinRequest",
45
51
  "ApiResponse",
46
52
  "ApiResponseJson",
47
53
  "ApiRequestBody",
@@ -360,3 +360,33 @@ class CreateInvitationResponse(BaseModel):
360
360
 
361
361
  class Config:
362
362
  populate_by_name = True
363
+
364
+
365
+ # --- Types for autojoin domain management ---
366
+
367
+ class AutojoinDomain(BaseModel):
368
+ """Autojoin domain configuration"""
369
+ id: str
370
+ domain: str
371
+
372
+
373
+ class AutojoinDomainsResponse(BaseModel):
374
+ """Response from autojoin API endpoints"""
375
+ autojoin_domains: List[AutojoinDomain] = Field(alias="autojoinDomains")
376
+ invitation: Optional[InvitationResult] = None
377
+
378
+ class Config:
379
+ populate_by_name = True
380
+
381
+
382
+ class ConfigureAutojoinRequest(BaseModel):
383
+ """Request body for configuring autojoin domains"""
384
+ scope: str
385
+ scope_type: str = Field(alias="scopeType")
386
+ scope_name: Optional[str] = Field(None, alias="scopeName")
387
+ domains: List[str]
388
+ widget_id: str = Field(alias="widgetId")
389
+ metadata: Optional[Dict[str, Any]] = None
390
+
391
+ class Config:
392
+ populate_by_name = True
@@ -13,7 +13,9 @@ logger = logging.getLogger(__name__)
13
13
 
14
14
  from .types import (
15
15
  AcceptUser,
16
+ AutojoinDomainsResponse,
16
17
  BackendCreateInvitationRequest,
18
+ ConfigureAutojoinRequest,
17
19
  CreateInvitationGroup,
18
20
  CreateInvitationResponse,
19
21
  CreateInvitationTarget,
@@ -781,6 +783,160 @@ class Vortex:
781
783
  )
782
784
  return CreateInvitationResponse(**response)
783
785
 
786
+ async def get_autojoin_domains(
787
+ self, scope_type: str, scope: str
788
+ ) -> AutojoinDomainsResponse:
789
+ """
790
+ Get autojoin domains configured for a specific scope
791
+
792
+ Args:
793
+ scope_type: The type of scope (e.g., "organization", "team", "project")
794
+ scope: The scope identifier (customer's group ID)
795
+
796
+ Returns:
797
+ AutojoinDomainsResponse with autojoin_domains and associated invitation
798
+
799
+ Example:
800
+ result = await vortex.get_autojoin_domains("organization", "acme-org")
801
+ print(result.autojoin_domains) # [AutojoinDomain(id='...', domain='acme.com')]
802
+ """
803
+ from urllib.parse import quote
804
+
805
+ response = await self._vortex_api_request(
806
+ "GET",
807
+ f"/invitations/by-scope/{quote(scope_type, safe='')}/{quote(scope, safe='')}/autojoin",
808
+ )
809
+ return AutojoinDomainsResponse(**response)
810
+
811
+ def get_autojoin_domains_sync(
812
+ self, scope_type: str, scope: str
813
+ ) -> AutojoinDomainsResponse:
814
+ """
815
+ Get autojoin domains configured for a specific scope (synchronous)
816
+
817
+ Args:
818
+ scope_type: The type of scope (e.g., "organization", "team", "project")
819
+ scope: The scope identifier (customer's group ID)
820
+
821
+ Returns:
822
+ AutojoinDomainsResponse with autojoin_domains and associated invitation
823
+
824
+ Example:
825
+ result = vortex.get_autojoin_domains_sync("organization", "acme-org")
826
+ print(result.autojoin_domains) # [AutojoinDomain(id='...', domain='acme.com')]
827
+ """
828
+ from urllib.parse import quote
829
+
830
+ response = self._vortex_api_request_sync(
831
+ "GET",
832
+ f"/invitations/by-scope/{quote(scope_type, safe='')}/{quote(scope, safe='')}/autojoin",
833
+ )
834
+ return AutojoinDomainsResponse(**response)
835
+
836
+ async def configure_autojoin(
837
+ self,
838
+ scope: str,
839
+ scope_type: str,
840
+ domains: List[str],
841
+ widget_id: str,
842
+ scope_name: Optional[str] = None,
843
+ metadata: Optional[Dict[str, Any]] = None,
844
+ ) -> AutojoinDomainsResponse:
845
+ """
846
+ Configure autojoin domains for a specific scope
847
+
848
+ This endpoint syncs autojoin domains - it will add new domains, remove domains
849
+ not in the provided list, and deactivate the autojoin invitation if all domains
850
+ are removed (empty array).
851
+
852
+ Args:
853
+ scope: The scope identifier (customer's group ID)
854
+ scope_type: The type of scope (e.g., "organization", "team")
855
+ domains: Array of domains to configure for autojoin
856
+ widget_id: The widget configuration ID
857
+ scope_name: Optional display name for the scope
858
+ metadata: Optional metadata to attach to the invitation
859
+
860
+ Returns:
861
+ AutojoinDomainsResponse with updated autojoin_domains and associated invitation
862
+
863
+ Example:
864
+ result = await vortex.configure_autojoin(
865
+ scope="acme-org",
866
+ scope_type="organization",
867
+ domains=["acme.com", "acme.org"],
868
+ widget_id="widget-123",
869
+ scope_name="Acme Corporation",
870
+ )
871
+ """
872
+ request = ConfigureAutojoinRequest(
873
+ scope=scope,
874
+ scope_type=scope_type,
875
+ domains=domains,
876
+ widget_id=widget_id,
877
+ scope_name=scope_name,
878
+ metadata=metadata,
879
+ )
880
+
881
+ response = await self._vortex_api_request(
882
+ "POST",
883
+ "/invitations/autojoin",
884
+ data=request.model_dump(by_alias=True, exclude_none=True),
885
+ )
886
+ return AutojoinDomainsResponse(**response)
887
+
888
+ def configure_autojoin_sync(
889
+ self,
890
+ scope: str,
891
+ scope_type: str,
892
+ domains: List[str],
893
+ widget_id: str,
894
+ scope_name: Optional[str] = None,
895
+ metadata: Optional[Dict[str, Any]] = None,
896
+ ) -> AutojoinDomainsResponse:
897
+ """
898
+ Configure autojoin domains for a specific scope (synchronous)
899
+
900
+ This endpoint syncs autojoin domains - it will add new domains, remove domains
901
+ not in the provided list, and deactivate the autojoin invitation if all domains
902
+ are removed (empty array).
903
+
904
+ Args:
905
+ scope: The scope identifier (customer's group ID)
906
+ scope_type: The type of scope (e.g., "organization", "team")
907
+ domains: Array of domains to configure for autojoin
908
+ widget_id: The widget configuration ID
909
+ scope_name: Optional display name for the scope
910
+ metadata: Optional metadata to attach to the invitation
911
+
912
+ Returns:
913
+ AutojoinDomainsResponse with updated autojoin_domains and associated invitation
914
+
915
+ Example:
916
+ result = vortex.configure_autojoin_sync(
917
+ scope="acme-org",
918
+ scope_type="organization",
919
+ domains=["acme.com", "acme.org"],
920
+ widget_id="widget-123",
921
+ scope_name="Acme Corporation",
922
+ )
923
+ """
924
+ request = ConfigureAutojoinRequest(
925
+ scope=scope,
926
+ scope_type=scope_type,
927
+ domains=domains,
928
+ widget_id=widget_id,
929
+ scope_name=scope_name,
930
+ metadata=metadata,
931
+ )
932
+
933
+ response = self._vortex_api_request_sync(
934
+ "POST",
935
+ "/invitations/autojoin",
936
+ data=request.model_dump(by_alias=True, exclude_none=True),
937
+ )
938
+ return AutojoinDomainsResponse(**response)
939
+
784
940
  async def close(self) -> None:
785
941
  """Close the HTTP client"""
786
942
  await self._client.aclose()