@@ -36,9 +36,6 @@ class OrganizationsStream(ClerkStream):
3636 th .Property ("updated_at" , th .IntegerType ),
3737 ).to_dict ()
3838
39- def parse_response (self , response : requests .Response ) -> t .Iterable [dict ]:
40- yield from extract_jsonpath ("$.data[*]" , input = response .json ())
41-
4239 def get_child_context (self , record : dict , context : t .Optional [dict ]) -> dict :
4340 return { "organization_id" : record ["id" ] }
4441
@@ -84,8 +81,25 @@ class OrganizationMembershipStream(ClerkStream):
8481 th .Property ("updated_at" , th .IntegerType , description = "Timestamp of when the membership was last updated" )
8582 ).to_dict ()
8683
87- def parse_response (self , response : requests .Response ) -> t .Iterable [dict ]:
88- yield from extract_jsonpath ("$.data[*]" , input = response .json ())
84+ class OrganizationInvitationsStream (ClerkStream ):
85+ """Organization invitations stream class."""
86+ name = "organization_invitations"
87+ path = "/organization_invitations"
88+ primary_keys = ["id" ]
89+ replication_key = None
90+ schema = th .PropertiesList (
91+ th .Property ("id" , th .StringType , description = "The unique identifier for the invitation" ),
92+ th .Property ("object" , th .StringType , description = "Type of the object, should be 'organization_invitation'" ),
93+ th .Property ("email_address" , th .StringType , description = "Email address of the invited user" ),
94+ th .Property ("role" , th .StringType , description = "Role assigned to the invited user" ),
95+ th .Property ("role_name" , th .StringType , description = "Name of the role assigned" ),
96+ th .Property ("organization_id" , th .StringType , description = "ID of the organization" ),
97+ th .Property ("status" , th .StringType , description = "Status of the invitation (pending, accepted, revoked)" ),
98+ th .Property ("public_metadata" , th .ObjectType (additional_properties = True ), description = "Public metadata" ),
99+ th .Property ("private_metadata" , th .ObjectType (additional_properties = True ), description = "Private metadata" ),
100+ th .Property ("created_at" , th .IntegerType , description = "Timestamp of when the invitation was created" ),
101+ th .Property ("updated_at" , th .IntegerType , description = "Timestamp of when the invitation was last updated" )
102+ ).to_dict ()
89103
90104class UsersStream (ClerkStream ):
91105 """Users stream class."""
@@ -251,15 +265,4 @@ class WaitlistEntriesStream(ClerkStream):
251265 th .Property ("created_at" , th .IntegerType ),
252266 th .Property ("updated_at" , th .IntegerType )
253267 ))
254- ).to_dict ()
255-
256- def get_url_params (self , context : dict | None , next_page_token : t .Any | None ) -> dict [str , t .Any ]:
257- params : dict = {"limit" : self .API_LIMIT_PAGE_SIZE }
258- if next_page_token :
259- params ["offset" ] = next_page_token
260- if self .replication_key :
261- params ["order_by" ] = f'+{ self .replication_key } '
262- return params
263-
264- def parse_response (self , response : requests .Response ) -> t .Iterable [dict ]:
265- yield from extract_jsonpath ("$.data[*]" , input = response .json ())
268+ ).to_dict ()
0 commit comments